How to get field message to stay &display after save/ submit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 02:16 PM - edited 06-11-2024 02:40 PM
I created a incident field message to display when a user has a priority status of elite selected on the user form and this will display under the caller field. however the message goes away once the incident is saved or submitted. how do i get it to display through out the different states or edits or submission/saved.
here is the client script it uses a script include to check the users status.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 03:42 PM - edited 06-11-2024 03:42 PM
Hi @DevtoSME,
Modify the first IF statement by removing the isLoading object, i.e.
if(newValue === ''){
This will make the script to run when the page loads (i.e. after submission)
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2024 05:01 AM
thank you this worked. Are you able to explain why removing that allowed the message to stay. We use the BPE (best practice engine) and a message came up that "onChange" client scripts should check for isLoading so i had to bypass that error.
thanks for the help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2024 12:34 PM
No worries, I am not sure what the BPE is (guessing it's some custom app), but isLoading object will return TRUE when the change occurs as part of a form load/refresh.
So, because of that, it will always return TRUE in the first IF statement, hence the rest of the script will never run when you open/refresh the form.
Frankly, I don't see why it's picked up by the BPE as this is commonly used practice. If it's a concern, you can always create another client script (onLoad) as well.
Hope that helps, cheers