Improve Mandatory check script and Readme#1984
Improve Mandatory check script and Readme#1984snamjosh merged 3 commits intoServiceNowDevProgram:mainfrom
Conversation
- Adjusted the script to instead of not displaying the state field, flash the fields that are not filled in. This makes more sense and is using this existing function: https://www.servicenow.com/docs/bundle/zurich-api-reference/page/script/useful-scripts/reference/r_UsefulFieldScripts.html#d471717e187 - The getMissingFields() returns an array. Joining it with commas to improve readability of the info message. - To prevent further execution added return statement.
Updated the readme text. - Highlighting what the code provides. - Putting focus on the additional functionality of the error message that is provided by the function already, which was not mentioned in the original. Updated with 2 new screenshots
snamjosh
left a comment
There was a problem hiding this comment.
Thank you for your contribution.
g_form.flash() doesn't work in service portal.
can you please update readme to include same?
or you can use g_form.showFieldMsg() in your client script code so that it works on service portal as well.
@snamjosh the official documentation also does not include that remark https://www.servicenow.com/docs/bundle/zurich-api-reference/page/script/useful-scripts/reference/r_UsefulFieldScripts.html#d471717e187. In addition, this script is in the Client script folder. There is a separate folder for Catalog client scripts. |
PR Description:
In this PR 2 files are adjusted to reflect a more realistic example, updated readme and updated screenshot:
Update script.js
Update README.md
Pull Request Checklist
Overview
Code Quality
Repository Structure Compliance <- Existing files updated
Core ServiceNow APIs/Server-Side Components/Client-Side Components/Modern Development/Integration/Specialized Areas/Documentation
Restrictions