How do I make an InfoMessage appear when a record is accessed?

Wayne Richmond
Tera Guru

I've created a BR on change_request to display an InfoMessage when the State field is Draft (0)

Condition: current.state==0;

Script:

(function executeRule(current, previous /*null when async*/) {

  // Add your code here

gs.addInfoMessage("This Change is currently in Draft format. To publish the record please press the Submit Change button");

})(current, previous);

However, the message only appears if I check Insert or Update and then update the record. I want the message to appear every time a user goes into the record, as long as the State is Draft.

I hope this is a nice easy one.

Thanks

1 ACCEPTED SOLUTION

Wayne Richmond
Tera Guru

Don't worry! Figured it out! When I clicked Advanced I have the option to 'display' in the When [to run] field:



find_real_file.png


View solution in original post

2 REPLIES 2

snehabinani26
Tera Guru

You need to right an onload client script for this functionality and have the same message in g_form syntax.



Hope this helps.



var state = g_form.getValue("state");


if(state == 0){


g_form.addInfoMessage("your message);


}


Wayne Richmond
Tera Guru

Don't worry! Figured it out! When I clicked Advanced I have the option to 'display' in the When [to run] field:



find_real_file.png