There are times when you need your flow to just pause and wait for a minute – either to allow something to finish or just so you can go get a cup of coffee.

If you add this function into your pflow.js file you can then call for a pause for the number many seconds you pass to the function.

/**************************************************
Function: sleep

Purpose: Runs for a specific number of seconds
Simulates a pause.
***************************************************/
function sleep(nSecs)
{
var initDate= today();
var currDate;
do
{
currDate = today();
}
while( currDate – initDate < nSecs * 1000);
return nSecs
}

Then use this call from an Assign node in the flow: sleep(120)

By adding the function to pflow.js, it is available as a function within your Assign node. If you don’t want to edit Infor’s delivered pflow.js file then you can create a pflow_user.js file with your function. The system will recognize both the standard file and this additional one. Be sure to update both your local copy and the copy on the server.

Octavio Rivera, Senior Technology Consultant

Subscribe

* indicates required

Expert Insights

Trending resources

What you need to know about Workday's new accounting center functionality

Workday’s accounting center is bringing new functionality. Get an introduction to the accounting center, learn how these changes impact your…

Change Fatigue is Real  

This year has been one for the books. Social distancing, wearing masks, new hand washing routines all against a backdrop of…

Remote Implementations: Improving Operations Amid Pandemic Uncertainty

As countries experience second or third waves of the coronavirus pandemic, many including the United…

There are times when you need your flow to just pause and wait for a minute – either to allow something to finish or just so you can go get a cup of coffee.

If you add this function into your pflow.js file you can then call for a pause for the number many seconds you pass to the function.

/**************************************************
Function: sleep

Purpose: Runs for a specific number of seconds
Simulates a pause.
***************************************************/
function sleep(nSecs)
{
var initDate= today();
var currDate;
do
{
currDate = today();
}
while( currDate – initDate < nSecs * 1000);
return nSecs
}

Then use this call from an Assign node in the flow: sleep(120)

By adding the function to pflow.js, it is available as a function within your Assign node. If you don’t want to edit Infor’s delivered pflow.js file then you can create a pflow_user.js file with your function. The system will recognize both the standard file and this additional one. Be sure to update both your local copy and the copy on the server.

Octavio Rivera, Senior Technology Consultant