- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2019 09:06 AM
Hello,
I have a choice variable on a table called Remote Access Account (u_nhl_remote_access) with choice options:
- Pending (pending)
- Complete (complete)
- Request Again (request_again)
The default value is pending. When the value is changed to request_again, I want the value to stay as request_again for 24 hours then automatically be set back to pending.
I have tried using this business rule: (using 30 seconds instead of 24 hours for testing)
But this is not working. When I select request_again, it will say "Running transaction" for 30 seconds then update. I want the field to save and then I an keep doing other things, come back in 30 seconds and it be updated to pending.
Any help would be greatly appreciated! Thank you!
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2019 09:18 AM
Hello Hannah,
I would suggest using a workflow for this. You could use a Timer in the workflow to wait 24hours and a WaitFor Condition to check that its all good still. Then add the script after that to update your field back to pending.
Let me know if you need help with this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2019 11:18 AM
Is there a way to see the running workflow to check if there is an error or something? Because nothing is happening as far as I can see
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2019 09:22 AM
If you don't want to implement a whole workflow this might be a perfect excuse to start messing about with the flow designer!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2019 09:23 AM
Ok that could be good! I'm just not sure how you start a workflow or a flow from a field on a table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2019 09:29 AM
you can use the following script in a before business rule when the Remote access account changes request again:
var wf = new Workflow().getRunningFlows(current);
if(!wf.next()){
var w = new Workflow();
var context = w.startFlow(current.INSERT WORKFLOW HERE, current, current.operation());
}
})(current, previous);
That will start a workflow you make which can have a timer which will update the record after 24 hours back to pending and end the workflow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2019 11:53 AM
Will this allow me to trigger the workflow more than once on one record?
For example, if I change a record to "Request Again" and after 24 hours the worfklow sets it back to "Pending". But then I set it to "Request Again" again, will it trigger a new workflow?