Using a variable in business rule add message field

richardhofing
Mega Expert

Hello all, I have a requirement for a business rule to prevent closure of an Incident under certain conditions. I did this using filter conditions (when to run). It works as expected. I have an additional requirement to display a message. The message is a string that contains a value of one of the fields on the form (the related change request).   Is there a way to insert the value of the field into the message? For example, now I get "Incident has an open Change request and cannot be closed" , but what I would like is "Incident has an open Change request (CHG0160031) and cannot be closed"

find_real_file.png

4 REPLIES 4

s_sterner
Mega Guru

Hi Richard,



Incident has an open Change request (${current.rfc}) and cannot be closed



rfc is the field name for the Change Request related record if thats the field you are talking about


Hi Sean, that is exactly what I was looking for and it works perfectly. Did you find this in the documentation somewhere?   Thank you very much for your help!



Regards,



Ric


Hi Richard,



Glad it was what you were looking for.



Heres a bit of info on what we just did
Template literals - JavaScript | MDN
Another SN example - What does ${} do in Client Script?


sachin_namjoshi
Kilo Patron
Kilo Patron

In your business rule, you can use current object to add reference number



like below



Incident has an open +   current.u_change_request + and cannot be closed



Regards,


Sachin