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

Hi Amit,
In that case the publishitem function will only call when your answer = true. but you want that it should not run when execution comes in the else part. so that code should be work it should not call the publisheitem function when it comes in the else part.
Also gsft statement also written in the if block only so it will run only that time when control comes inside if.




I request you to test it once like that control goes inside else part then see the function is calling or not?



Regards,


Abhimanyu Bansal


-----------------------------------------


Kindly LIKE or MARK Correct/Helpful, if you are satisfied with my response.


PFA modified code. publishitem still gets executed.



find_real_file.png


Hi Amit,



I tried to replicate the issue and found that g_form.save() is causing the issue.


This function saves the form and stays on the same page but it does call the server and reloads the page after setting values.



find_real_file.png




I commented the code for g_form.save and it stayed on the same page.


Please try this approach.




Thanks


Gaurav


somehow i believe that the values on the form would not be updated/replaced with the new values ,with this particular approach.Please correct me if I am wrong.


Hi Sharique,



g_form.save() does save the values on the form(whatever changes you make on the form).


Tried and tested