Use break or exit in UI action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2017 01:16 AM
If the else block is executed, the function publishitem() will not run. Can this be achieved ?
PFA snapshot as I am not able to copy paste the code.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2017 01:20 AM
Hi Amit,
Try adding return false inside the else condition.
Thanks
Gaurav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2017 01:24 AM
Hi Gaurav,
I cannot add return false, as that will stop the submission.
I am using else block to change the state and save the form.
Regards,
Amit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2017 01:30 AM
Hi Amit,
you can try one thing.
Write the publishitem() function outside the cnfmbox() function and call the publishitem() inside the if condition.
Regards,
Abhimanyu Bansal
-----------------------------------------
Kindly LIKE or MARK Correct/Helpful, if you are satisfied with my response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2017 01:48 AM
Hi Abhimanyu,
Had tried that before and did that once again.
The function publishitem still gets executed. The reason could be because of the gfst line, which is calling the UI action once again and making it to execute the server side code.
Regards,
Amit