Run Procedure
Process Steps can run an SQL Statement. Enter a complete and valid T-SQL Statement in the SQL Statement field. The limit on the length of the statement is 1,000 characters.
You can use the following tokens as parameters in your query:
- dp_RecordID: The ID of the record invoked by workflow.
- dp_UserID: The user record ID of the user in the step's Task Owner.
- dp_DomainTime: Represents the current time according to the Time Zone set in the Domain record.
For example, a Process exists to receive approval for employee time off. The church allows each employee a number of days. This information is stored in a custom field on their user record. Once time off is approved, we want the next step in the process to subtract the value from individual's remaining time off. This step runs a procedure and the SQL Statement might be:
UPDATE dp_UsersSET Remaining_Time_Off = Time_Off_Hours_Remaining - ISNULL((SELECT Hours_Missed FROM Time_Off WHERE Time_Off_ID = dp_RecordID),0)WHERE User_ID = dp_UserID