UI Action validation before process the action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2017 06:22 PM
Hello All,
I would like to get some advise on validating UI policies in generic way. Let me put a scenario to make it more simpler.
In our change module, we have two UI actions in implement state. Let's call them as "Implementation Complete" and "Revert to Assess".
1. When "implementation complete" button is being hit, it asks for two mandatory fields (i.e. closure details). Upon filling the mandatory field, If user hit the SAME button, system sets a flag (implementation complete) to true which triggers the workflow to next state.
2. When "Revert to assess" is being hit, it asks for another mandatory field (reversion detail). Upon filing field,If user hit the SAME button, system sets a flag (reversion flag) to true which in turn regress the workflow.
Here, I am pressing the word "SAME" . Because at times, user hit the "Implementation complete" button, fill out the mandatory fields and hit the another button "Revert to assess". Based on our functionality, flag set up, it triggers the 1st button (Implementation complete) and processed.
My concern is the mandatory fields that are filled in remain and non empty and get stored in the DB which creates issue if the same button is being again, as it has to make field mandatory which is already filled in.
Having said that, I would get advise/suggestion to have a generic way of validating UI actions being pressed.
Regards,
GB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2017 08:50 PM
Hi GB,
I believe this is sort of scenarios based problem where logic needs to handle and prevent user from doing mistakes.
I would suggest to set closure fields(set flag accordingly off-course) empty if 'Revert to Assess' hit and set reversion details(set flag accordingly) empty if 'Implementation Complete' gets hit. This has to be done on both UI Action Script.
- Vipin Verma
PS: Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2017 07:05 AM
Thanks Vipin!
Yes, Exactly, Prevent users from making mistakes on populating wrong mandatory fields which eventually gets stored in the Data Base.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2017 09:46 PM
g_form.getAction will give you the button that was pressed. So in short, you can use that function in an on-submit script and validate which button was clicked. Based on the button clicked, clear out the fields that are not required or are causing an issue in the process. Alternatively, you could set up business rules on your table, that would check the state of the request and clear out fields that are not required.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2017 07:09 AM
Thanks Kalai!
Yes, I should go for business rule. Probably have generic script include and call that function on the required business rule.