- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2024 12:50 PM
Hello All,
I have what I assume is a very simple action that I can't seem to figure out and I was hoping you all might be able to provide some help.
I have a field "Field A" that is a reference to the sys_user table on my Change Request form. I am trying to default the value of that field to the Requestor of the Incident that this Change was created from. The Incident has a link to the Change via the rfc field in the Incident table and the Change has a link to the Incident via the related list "Incidents Pending Change", but I can't find a working method of pulling. In addition, this should only be defaulted one time, when the Change is first inserted from the Incident, as I need people to be able to populate that field manually and not have it revert.
I thought I had a script that would work applied to the Change table, but running it as either a business rule on Insert, or a Client Script on Submit, it doesn't appear to do anything. Does anyone have an approach from this one? Or an idea of where my script is breaking down as I can't seem to get the debugger to work?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2024 01:10 PM
That looks like code for a BR, which would be Server side and g_form is not a server side object. Use
current.setValue("field_a_name", requestor);
In place of the appropriate lines of code.
But you also have a chicken and egg thing going on. The incident cannot but updated until the change is inserted but the change is querying for the incident before its updated. So you going to have to update the code that is creating the change in the first place to set "Field A" before the change is inserted. I'm assuming you are using a UI Action of some type to cause the change to be created and that is where you need to set "Field A".

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2024 01:10 PM
That looks like code for a BR, which would be Server side and g_form is not a server side object. Use
current.setValue("field_a_name", requestor);
In place of the appropriate lines of code.
But you also have a chicken and egg thing going on. The incident cannot but updated until the change is inserted but the change is querying for the incident before its updated. So you going to have to update the code that is creating the change in the first place to set "Field A" before the change is inserted. I'm assuming you are using a UI Action of some type to cause the change to be created and that is where you need to set "Field A".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2024 01:21 PM
You hit the nail on the head, the code adjustment makes sense, and may have worked, but it was much easier to just populate that field from the Incident as part of the OOB Create Normal Change UI Action. Thanks for getting me on the right track!