UI action reload page?

Community Alums
Not applicable

Hi All,

I have the below UI action for requesting manual approval from an SCTASK record which triggers a workflow, triggers an event to send an email and remains in the same page on submit -

find_real_file.png

 

Script -

gs.eventQueue('approval.needed', current);


//Start the manual approval workflow
var workf = new Workflow();
var contex = workf.startFlow('215102651be501108496a822b24bcb6d', current, 'update');

action.setRedirectURL(current);

 

The only thing now missing is to also refresh the page/current record, as the state needs to update to requested and the approvers list needs to update - both of which work on a manual refresh of the page.

This isn't a client UI action so I'm not sure how to achieve this.

Any help would be much appreciated.

Thanks!
Alex

3 REPLIES 3

palanikumar
Mega Sage

Hi,

The workflow takes few seconds to start and it runs in the background. That is the reason why form is not updated immediately, but works after you hit refresh button manually

Thank you,
Palani

shloke04
Kilo Patron

Hi,

Try using the below line of code in your UI Action with an addition of a delay so that when you click the UI Action after certain fraction of seconds it gets refreshed again:

gs.sleep('Enter the milli seconds here);
location.relod(true);

Note higher sleep time may impact performance so may be try with different combinations which is least milli seconds work for you.

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

shloke04
Kilo Patron

Please let me know if you are stuck, can assist you further.

If your query is resolved then please mark my answer as correct and close this thread for others.

Regards,

Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke