The CreatorCon Call for Content is officially open! Get started here.

Client Script: Getting Value of a Field Not On Form

JosephW1
Tera Guru

Hello,

How do I get the value of a field not shown on the current form from within a client script? I'm trying to get the value of incident.child_incidents from a client script for incident.

I've tried "g_form.getValue('child_incidents')" but it returns undefined unless I pull the field onto the form. However, I do not want this field on the form. If I remove the field, it goes back to returning undefined. How do I get around this?

Thanks!

Kind Regards,
Joseph

1 ACCEPTED SOLUTION

Matthew Glenn
Kilo Sage

A few choices here:

  1. Put the field on the form and hide with a UI Policy. 
  2. Retrieve it via a GlideAJAX call
  3. Use a Display Business Rule to put the field value on the scratchpad for use

There may be other methods, but these are the 3 that come to mind.

View solution in original post

6 REPLIES 6

did you tell the script to save the form after setting it? you can either do it via script or manually via a save button, just because you are populating a field with a value, doesn't mean its saving the value to the field.

Hemant Kumar Ch
Kilo Sage

Try add g_form.setValue('field_name',response) in client script