
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2020 11:29 AM
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
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2020 12:00 PM
A few choices here:
- Put the field on the form and hide with a UI Policy.
- Retrieve it via a GlideAJAX call
- 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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2023 06:08 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-21-2023 08:47 PM
Try add g_form.setValue('field_name',response) in client script