cancel
Showing results for 
Search instead for 
Did you mean: 

GetFieldValue returns Null in View Mode

TamarShelach
Archer Employee
Archer Employee

Hi

We have a custom object that returns text field value: 

<script>
Sys.Application.add_load(function() {
var myField = ArcherTech.UI.GenericContent.GetInstance().getFieldValue(19609);
document.getElementById("myID").innerHTML = myField;
});

We display the returned value (myField) in a bar at the top of the record.

It work great in Edit mode but returns NULL in View mode.

Any idea why? how can we solve it?

 

(Yes, I'm new with that custom objects thing )

2 REPLIES 2

DavidPetty
Archer Employee
Archer Employee

Fields work differently in Edit mode vs. View mode.

 

You'd have to determine the record state: 

ArcherTech.UI.GenericContent.GetInstance().get_mode();   // 1 = Edit, 2= View

 

Then, inspect the field in question in view mode and setup the custom object to retrieve the value.  Something like:

$('div[id$="f'+ fldid + '"]').text().trim();
//or
$('span[id$="f'+ fldid + '"]').text().trim();‍‍‍

 Advisory Consultant - Archer, an RSA Business

Rock star response David Petty‌! Learned something new => 

ArcherTech.UI.GenericContent.GetInstance().get_mode();