Adding a alert message

brown9394
Tera Expert

Hello,

I want to add an alert message to users on top of the form when they click 'New' to create a new incident to 'attach a document'. Is this possible via UI Macro or any other way? I do not want it to be a hard stop, the user is still able to 'submit/save' the record, and move on to the next state.

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

Something like this... untested code ahead:



function onLoad() {


        if (g_form.isNewRecord()) {


                  g_form.addInfoMessage('Please attach a file. Thank you.');


        }


}


View solution in original post

8 REPLIES 8

Thank you Michael for your help. It worked better with a client script than business script.


How might I modify this script if I only wanted it to display when the state was New (value = 1)?


I tried this, but it does not work. (I am trying to add an alert to the Standard Notification Proposal form so that our team members remember that submitting it will send a notification. This is only necessary in the "New" State as it moves to a different State after they click on "Request Approval."



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



      if (current.state('1')) {


              gs.addInfoMessage("When you click on Request Approval, a notification will be sent to all of the IT managers and directors that a new Standard Change Approval is available for them to review and approve.");


      }



})(current, previous);



thanks,


Richelle


harishdasari
Tera Guru

HI James,



As Chuck suggested you can fallow the OnLoad client script to display a alert message, and also you can use Business rule to stop saving or submitting the record without an attachment.



Thanks


Thanks! that works.