CheckTaskDone()
This code sample describes how to verify that a workflow participant has specified values in all of the required workflow attribute fields on the Project and Customer tabs before the workflow is routed to the next workflow participant.
Function List CheckTaskDone( \ Object prgCtx, \ Dynamic data ) String msg String name List retVal = { True, '' } //Examine each workflow attribute field on the Project and //Customer pages on the Table Values tab, and determine which //fields are required. If a value has not been entered in a //required field, return a message indicating that a value is //required for that field. for name in Assoc.Keys( data.Fields ) if ( name in data.Required ) if ( !IsDefined( data.fields.Name ) ) msg = Str.Format( 'A Value is required for the' + \ 'table value %1.', \ Str.Quote( name, '"' ) ) retVal = { False, msg } break end //If the creator of a workflow map specified that the //Customer field is a required field for this task (which //means that the entire Customer tab is displayed to //workflow participants in the work package), verify that //the workflow participant has entered a value in the //Customer Name field on the Customer tab. If a value has //not been entered, return a message indicating that a name //for the customer is required. if ( Str.Upper( name ) == 'CUSTOMER' ) if ( !IsDefined( data.Fields.Customer.Name ) ) msg = 'You must enter a name for the customer.' retVal = { False, msg } break end end end end return( retVal ) end