Your Knowledge Base has moved to the new Help Center.  Check out the release notes for details. And don't forget to update your bookmarks and in-house documentation before May 28.

Run Procedure

 

Process Steps can run an SQL Statement. A complete and valid T-SQL Statement should be in the SQL Statement field. The limit on the length of the statement is 1000 characters.

The following tokens can be used as parameters in your query:

  • dp_RecordID: The ID of the record invoked by workflow.
  • dp_UserID: The user record ID of the user resolved 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 get approval for employee time off. The church allows each employee a number of days. This is stored in a custom field on their user record. Once time off is approved, we want the next step in the process to decrease the value of that user's remaining time off. This step runs a procedure and the SQL Statement might be:

UPDATE dp_Users
SET 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
Notes: The above is just an example. It is not meant to illustrate existing functionality. It assumes you have customized the User table with fields that are not currently in the out-of-the-box version of that table. You might want to work with Professional Services for help writing valid SQL statements for this field.