UI action

Snow-Man
Tera Contributor

 Hi

 

I need to create a UI action (Validate User) on the user table. 

as soon as it is clicked, it should trigger a script include to fetch the OTP and then send that otp to the phone number using notify and Twillio (configuration is sorted)

after that, a prompt or pop should open asking for the otp

 

how can I first call a business rule and then on-click client script on UI action because normally the order is first on click client script and then business rule, Please help 🙂

1 ACCEPTED SOLUTION

Anurag Tripathi
Mega Patron
Mega Patron

There are 2 ways i can think of

1)

You can have a client side ui action.

In the client script use Glide Ajax to pass the control to server side and run the server script.

Then return to the client side and run the Client Code in the callback function.

 

2)

Have a custom field or flag on the form

On the ui action only run the BR, Then in the BR change the value of the custom field

in the client script, check for the flag and only run the code when the flag is changed.

-Anurag

View solution in original post

3 REPLIES 3

Anurag Tripathi
Mega Patron
Mega Patron

There are 2 ways i can think of

1)

You can have a client side ui action.

In the client script use Glide Ajax to pass the control to server side and run the server script.

Then return to the client side and run the Client Code in the callback function.

 

2)

Have a custom field or flag on the form

On the ui action only run the BR, Then in the BR change the value of the custom field

in the client script, check for the flag and only run the code when the flag is changed.

-Anurag

Hello Anurag,

A BIG, BIG thanks to you, I used the first way to create a script include and then run server code in it. Thanks a ton once again!!! 

Happy to help.

-Anurag