Did You Know?
The ATC: SET workflow script command can be used to set Item dates on a document to “today’s date.” For example, if you want to automatically set the Requested Date on a Submittal, or the Submitted Date on a Submittal Package, you can do that through workflow scripts.
First Step:
Find the name of the Date field that you want to set automatically.
- Go to the document’s Item tab, expand it if necessary, and click on the date field. The name of the field will appear at the footer, after the period. For example, the field below is Requested.
Second Step:
Add a new workflow script.
- Go to the Workflow Scripts tool on the System Admin Dashboard.
- Filter by the Doc type to see if you can add commands to an existing script or if you need a new one.
- If you are going to add to an existing script, skip to step 7
- If you need a new script, click the + icon and give your script a name, then save.
- Find and expand the script row to get to the Events For section.
- Select your Doc type and click the + icon to map the Doc type to the script.
- Select your Trigger When condition (often Normal Saves) then save.
- Click the script icon.
- For the simplest workflow script, you will need the following commands, where Requested can be replaced by the name of the Date field that you determined in the First Step.
ATC: FOREACH DocItem BY DocItemNumber
ATC: SET @.Requested= NOW()
ATC: ENDLOOP - You can add additional commands or parameters to your script. For example, if you want to set the Submitted Date to today for Items that have the Submitted status only (S), you could write a script such as:
ATC: FOREACH DocItem BY DocItemNumber WITH ItemStatus = ‘S’;
ATC: IF @.ItemStatus IsChanging
ATC: SET @.Submitted = NOW()
ATC: ENDIF
ATC: ENDLOOP