"Cancel Change" UI action won't cancel until I fill out all mandatory fields (due to an onSubmit client script)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2017 09:28 AM
I have an onSubmit client script set up for change requests that makes fields mandatory. I also have a "Cancel Change" Ui action. My problem is that when I hit the "Cancel Change" UI Action, I'm still forced to fill in all mandatory fields before the cancellation occurs. Is there any way to work around this? Perhaps have the client script not activate if that button is pressed? I'm not sure what would be the best way to go about this issue.
- Labels:
-
Change Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2017 09:31 AM
Hello Shant,
You may find the below thread helpful.
Saving a record without populating all mandatory variables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2017 09:50 AM
Instead of a Client Script to make fields mandatory I would use a Dictionary Override for each variable or a UI Policy with UI Policy Actions.
Hope this helps and let me know if you need more clarification! I think the cancel button might work if you make fields mandatory this way.
EDIT: Just tested this and it does not work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2017 04:50 PM
Hey Shant,
I'm assuming that you're using the OOB 'Cancel Change' UI Action that runs on the server side. My proposed solution is to create a new client-side UI Action that will replace the button on your change_request form which will turn of all mandatory fields on the form and then call the original server-side 'Cancel Change' UI Action.
1. Start by making some adjustments to your 'Cancel Change' UI Action
- set 'Action name' to 'cancel_change'
- unchecking the form context menu flag
2. Create a new UI Action and make it like the one below:
- client=true
- form_context_menu=true
- onClick contains your function call
- gsftSubmit() is calling the action name set in your original UI Action - 'cancel_change'
This should work regardless of how/where you set your mandatory fields for the form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2018 05:50 AM
This was very helpful. Thank You very much!