Important Update: Community URLs redirect issues are partially resolved. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Selected Value from Value-list field in Custom Object

TamarShelach
Archer Employee
Archer Employee

Hi,

I would like to pull the value selected in a certain value-list field but without using the DOM element of the field.

I need it because the filed is hided from the layout....

I was trying to use ArcherTech.UI.GenericContent.GetInstance().getFieldValue(..) but it doesn't fetch the value...

Is there a different "get" function I shall use for Value-List fields?

1 ACCEPTED SOLUTION

Accepted Solutions

Thanks.

 

Try changing the values list to either drop-down or radio-button if it's configured as values popup and see if that helps.

 Advisory Consultant

View solution in original post

6 REPLIES 6

DavidPetty
Archer Employee
Archer Employee

Tamar if the field is off the layout the only way to get it's value is to use the REST API and retrieve record content.

 

I'd recommend putting the field in a section on the layout and have a DDE hide that section.  Then the custom object will be able to get it's value.

 Advisory Consultant

We have added the field to the layout but still not getting it's value ArcherTech.UI.GenericContent.GetInstance().getFieldValue(..) any idea why?

Tamar can you post the complete code for the custom object?

 Advisory Consultant

Hi David, 

Here is the code:

 

<script>

Sys.Application.add_load(function() {
   var value = ArcherTech.UI.GenericContent.GetInstance().getFieldValue(19754);
});

</script>
<script type='text/javascript' src='/RSAarcher/api/scripts/clientX/archerXParms-SN.js'></script>
<script type='text/javascript' src='/RSAarcher/api/scripts/clientX/archerUiExtension.js'></script>
<script type='text/javascript' src='/RSAarcher/api/scripts/clientX/archerClientExtensionX.js'></script>
<script type='text/javascript' src='/RSAarcher/api/scripts/clientX/archerClientExtensionServiceNow.js'></script>

I want to get the value before the scripts I am running afterwards.

Thanks.

 

Try changing the values list to either drop-down or radio-button if it's configured as values popup and see if that helps.

 Advisory Consultant

Worked! Thanks David!