
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2022 05:28 PM
Hi all,
Have tried trawling Community for an answer for this but have had no luck. I am experiencing an issue with a custom task type having approvals load after the page refreshes via UI Action.
Code:
current.state = 5;
current.update();
action.setRedirect(current);
I tried adding the following, however the page then reloads to the previous screen instead:
current.state = 5;
gs.sleep(1000);
current.update();
action.setRedirect(current);
I've tried looking at the Change Request table as this works correctly, however have been unable to figure this out. Should I store the URL somehow and then redirect to this? Or is there an easier method?
Any help would be appreciated 🙂
Thanks,
Chris
Solved! Go to Solution.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2022 08:53 PM
Hi,
There is a small error in you code.
Its setRedirctURL() not setRedirct()
Try below code
current.state = 5;
current.update();
action.setRedirectURL(current);
Please mark my response as correct answer or helpful if applicable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2022 08:53 PM
Hi,
There is a small error in you code.
Its setRedirctURL() not setRedirct()
Try below code
current.state = 5;
current.update();
action.setRedirectURL(current);
Please mark my response as correct answer or helpful if applicable.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2022 09:15 PM
Hi Mahesh,
Something so simple that I completely missed! Thanks for your help.
I updated the code to this and had the desired effect:
current.state = 5;
current.update();
gs.sleep(1000);
action.setRedirectURL(current);
Thanks again,
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2022 09:22 PM
Hi,
Why are you making use of gs.sleep() ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2022 09:26 PM
Hi Mahesh,
I need the UI Action to wait until the Related Lists have loaded before refreshing. Hence the 1 second delay.
Thanks,
Chris