The CreatorCon Call for Content is officially open! Get started here.

Use break or exit in UI action

Amit Pal1
Tera Contributor

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.

16 REPLIES 16

Gaurav Bajaj
Mega Sage

Hi Amit,



Try adding return false inside the else condition.




Thanks


Gaurav


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


Abhimanyu Bansa
Giga Expert

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.


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