Unable to get value of referance field in client script

Snehal13
Kilo Sage

I am trying to get value of ref field in client with g_form.getValue("fieldname"); but it returns nothing.

Even g_form.getDisplayBox("fieldname"); gives no value.

All other field values are getting returned in the client script except ref field.

What is alternative.

12 REPLIES 12

@Snehal13 please check if you are using the correct backend name of the field inside getValue 

Yes. Using proper name. Infact, one other field which is a referance field value is getting alerted in same client script. that ref field is also usingg_form.getValue

I forgot to add- This is a workspace client script. 

var value = g_form.getDisplayBox('fieldName').value; isnt working. g_form.getValue("fieldname");  also not working to retrieve value

This used to work but seems not to be working now. What about g_form.getReference() or GlideAjax?

Did you try that?

Regards,Shamma Negi

Snehal13
Kilo Sage

I get no value in alert for var value = g_form.getDisplayBox('fieldName').value;