SaveData()

This code sample describes how to save the information that the initiator of a workflow specifies on the Project and Customer pages for the Start task before routing the workflow to the first workflow participant.

		function Dynamic SaveData( \
			Object 		prgCtx, \
			Record 		request, \
			Assoc 		data )
			
			Assoc 		fields
			Assoc 		retVal
			String 		name
			Integer 	pane = Str.StringToInteger( request.CustPaneIndex )
			
			retVal.OK = True

			//Save the values of the fields on the Project tab.

			if ( pane == 1 )
				fields = data.Fields
				fields.Project_Name = request.project_name
				fields.ID_Code = request.ID_Code
				fields.DueDate = Str.StringToValue( request.DueDate )
				fields.Priority = Str.StringToInteger( request.Priority )
				
			//Save the values of the fields on the Customer tab.

			elseif ( pane == 2 )
				fields = data.Fields.Customer
			for name in Assoc.Keys( fields )
			
			if ( IsFeature( request, name ) )
				fields.( name ) = Request.( name )
			end
		end
	end
	
		retVal.Data = data
	return( retVal )
end