- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2023 04:49 AM
Hi all,
I would like to automatically update "additional comments" with text when a catalog task (sc_task) state changes to "awaiting caller" state choice, so when I select "awaiting caller" and then save the form, then the additional comments should automatically update with text.
The requirements above needs to be achieved only for "hardware request" catalog item and only for the task called "check stock".
Many thanks in advance.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2023 07:28 AM - edited 03-16-2023 07:29 AM
Hi,
You can accomplish this via a before business rule on the catalog task table, with conditions such as "state changes to awaiting caller" AND dot-walk to the request item by scrolling to the bottom of the field options in the condition builder and selecting "show related fields":
and then choosing request item > name contains "Hardware request" or however else you want to filter for this one request item AND that the task (not request item) short description contains "Check Stock" or again, however you want to filter for the task short description/field.
Then you can select the advanced checkbox and then use script and set it as appropriate such as:
current.comments = "Hello world!";
DO NOT USE current.update() to update the record, the before business rule will do that automatically for you.
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2023 07:16 AM
Please change that to Before business rule and write below script
current.additional_comments= 'Your Text';
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2023 07:29 AM
not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2023 06:13 AM - edited 03-16-2023 06:19 AM
@cicgordy
you can use on change client script with field name as state and table as task
and use the following code
var state = g_form.getValue('state');
if(state== backend name of the state){
g_form.setValue('comments', 'text you want to add');
}
Also, what text do you want to set automatically
can you please elaborate on this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2023 07:13 AM
Hi @ritu_saluja,
I need this only for one task of a catalog item, so I guess I need to add more code querying the catalog item name and the name of the catalo task.
I just need to add some normal text to additional comments field when state changes to awaiting caller.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2023 07:28 AM - edited 03-16-2023 07:29 AM
Hi,
You can accomplish this via a before business rule on the catalog task table, with conditions such as "state changes to awaiting caller" AND dot-walk to the request item by scrolling to the bottom of the field options in the condition builder and selecting "show related fields":
and then choosing request item > name contains "Hardware request" or however else you want to filter for this one request item AND that the task (not request item) short description contains "Check Stock" or again, however you want to filter for the task short description/field.
Then you can select the advanced checkbox and then use script and set it as appropriate such as:
current.comments = "Hello world!";
DO NOT USE current.update() to update the record, the before business rule will do that automatically for you.
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!