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

Add delay to my ui action

MaharshiC
Tera Contributor

Hi,

 

I have an ui action which creates a new task. Now once its clicked it takes a few seconds for the task to get created. Now if the user clicks multiple times on the ui action at the same time then it creates multiple tasks. So i need to deactivate my ui action or add a delay of maybe 10 sec before it can again be clicked. How can this be achieved?

18 REPLIES 18

@MaharshiC 

I don't think you can control it.

You will have to train your users/agents.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Chaitanya ILCR
Mega Patron

Hi @MaharshiC ,

Only one task should be created when the UI action is clicked?

why not hide it if a task is already exist(once ui action is clicked and task has been created)?

 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

Hi @Chaitanya ILCR ,

 

Yes we are hiding it but the problem is that they are clicking multiple times at the same moment and not waiting for the task to get created and the page to load. I need to find a way to disable the u action for some time once its clicked

Community Alums
Not applicable

Try to hide UI action in onClick Function, make it a combo of client and server.

Use DOM in onClick Function.

Hi @MaharshiC ,

the creation of new task how much is it gonna take?

is there any integration of something which is taking time to create the task?

if no the button will be hidden instantly

 

if the task creation takes time

you can go with below approaches

1. create an field(checkbox) as soon as the button is clicked  update the checkbox as true and add condition that checkbox is not = true (useful when multiple users are expected to work on same form at the same time)

 

2. Store  Session data gs.getSession().putClientData() and getClientData methods To store the value like whether the button is clicked or not and use those values(useful if only one user is expected to work on the form at a time)

 

 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya