- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2024 10:53 AM
Hey all,
I am working on creating a business rule that will set the short description of an incident inserted to "Compensation Change: " +producer.variable_name.
When I test the script the short description comes back as: "Compensation Change: Undefined" no matter what I append to the script.
For reference I have appended a screen snip of the script itself. In addition the "comp_associate_name" is a reference field to the sys_user table and it displays information correctly within the record producer itself, which also has a screen snip attached.
Any assistance is greatly appreciated as this has been a hard stop and I am working to resolve this problem in my environment.
Thank you in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2024 03:04 PM
For variables, you should use current.variables.<variable_name> where your replace <variable_name> with the particular variable you're trying to access. Since it's a reference field that you're trying to access, you'll also want to call .getDisplayValue() on your variable:
current.work_notes = "Compensation Change: " + current.variables.comp_associate_name.getDisplayValue() + "\n";
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2024 03:04 PM
For variables, you should use current.variables.<variable_name> where your replace <variable_name> with the particular variable you're trying to access. Since it's a reference field that you're trying to access, you'll also want to call .getDisplayValue() on your variable:
current.work_notes = "Compensation Change: " + current.variables.comp_associate_name.getDisplayValue() + "\n";
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2024 04:28 PM
Hey @glawson_pgatss,
You should be using the Record Producer script for this, not a Business Rule.
The script will be something like:
current.short_description = "Compensation Change: " + producer.variable_name;
Cheers

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2024 04:57 PM - edited 03-05-2024 04:58 PM
Hi @glawson_pgatss Since this is a record producer, you dont need a Business rule on incident table to do this, you can use script section of the record producer to map the variables like below
Harish