- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2015 12:08 PM
So for my current project, I need to set an error message on a planned start date field or planned end date field if they are outside the parameters set. I have everything working fine, meaning my conditions are all correct, but I cannot figure out how to get the error message to appear. Here is the code:
current.u_planned_end_date.setError("Please change the above date");
current.u_planned_start_date.setError("Please change the above date");
the names are correct (u_planned_etc.), for they worked in other code used inside the same rule, and I tried using "gs" instead of "current" just in case that was an option and it still did not work. Any ideas?
Thank you in advance!
Update: I found that code through the wiki page Scripting Alert, Info, and Error Messages - ServiceNow Wiki
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2015 12:19 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2015 12:17 PM
I was able to get this to work out of the box. I had a before insert/update business rule that set the error and aborted the action.
Are you using business rules or client scripts?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2015 12:19 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2015 12:27 PM
Maybe you could try this: Scripting Alert, Info, and Error Messages - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2015 12:31 PM
thank you but that is the link i actually included in my initial description