auto-updating "additional comments" with text when catalog task state changes to "awaiting caller"

cicgordy
Tera Guru

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.

1 ACCEPTED SOLUTION

Allen Andreas
Administrator
Administrator

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":

AllenAndreas_0-1678976958122.png

 

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!

View solution in original post

10 REPLIES 10

Harshal Aditya
Mega Sage
Mega Sage

Hi @cicgordy ,

 

Hope you are doing well.

You can easily achieve your requirement by using on change client script with display BR.

 

Please Mark My Response as Correct/Helpful based on Impact

Regards,
Harshal

 

 

Hi @Harshal Aditya , can you please help with code?

Hi @cicgordy 

 

you can write After update business rule on catalog task when state chnages to awaiting caller. In the Actions you can set comments to your desired text.

 

 

priyasunku_0-1678971841098.png

 

If my answer solved your issue, please mark my answer as Correct & 👍Helpful

Hi @priyasunku,

I tried this but when I try to set field values for the action, additional comments doesnt appear there. Any suggestions?