Share via


Script Procedure Names

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Script procedure names are based on the Name property of each state or transition, combined with the name of the event that triggers the script. These procedure names are added to the Code Editor when you double-click an event icon on the workflow process diagram. In addition, you can construct them by selecting a state or transition name from the Object list at the top of the Code Editor and then selecting an event from the Event list.

For example, if you add a transition from a state with Name property New to a state with Name property Review and you name the transition NewReview, then the validation script procedure for that transition is named NewReview_OnChangeValidate.

  • NewReview refers to the Name property of the transition with which the event is associated.
  • OnChange means this is an OnChange event triggered when a record that is in the state New is set to the state Review.
  • Validate means this is a validation script procedure.

States have OnEnter and OnExit events associated with them. The script procedure for the OnEnter event of the state named Review is Review_OnEnter, and the validation script procedure is named Review_OnEnterValidate. Similarly, the OnExit script procedures are named Review_OnExit and Review_OnExitValidate.

A transition between states, and a Transition Within on a single state, has an OnChange event associated with it by default. The script procedure for the OnChange event of the transition named Change1 is Change1_OnChange, and the validation script procedure is named Change1_OnChangeValidate.

A transition from the Item Created shape to a state has an OnCreate event associated with it, rather than OnChange. The script procedure for the OnCreate event of the transition named Create1 is Create1_OnCreate, and the validation script procedure is named Create1_OnCreateValidate.

A transition from a state to the Item Deleted shape has an OnDelete event associated with it, rather than OnChange. The script procedure for the OnDelete event of the transition named Delete1 is Delete1_OnDelete, and the validation script procedure is named Delete1_OnDeleteValidate.

A transition that has the Type property set to Expiry has an OnExpire event associated with it, rather than OnChange. The script procedure for the OnExpire event of the transition named Expiry1 is Expire1_OnExpire, and the validation script procedure is named Expire1_OnExpireValidate.

See Also

When to Use Which Event | Control of Row Changes Based on State | OnEnter and OnExit Events | OnExpire Events | Adding Transition Events | Automating Changes and Events