NOTICE: You are in the old ClientSpace Help system. Please link to the new ClientSpace Help here https://extranet.clientspace.net/helpdoc/home/ClientSpace.htm

Business Rule Methods


This article provides a list of methods, a description of the method, and the accompanying parameters.

Clear Field Rules

You can automatically clear a field based on a specific trigger condition.

MethodDescriptionParameters
_ClearFieldValueClears the value in a specific field on save.
  • sFieldName (field to be set)
  • sFieldValue (value to be entered in the field)
_ClearTabFieldValueClears a field on the sTabTableName dataform on save.
  • sTabTableName (Dataform Table of Tabbed Dataform)
  • sFieldName (field to be set)


Create Field Rules

MethodDescriptionParameters
_CreateCalendarEvent
  • FieldName
  • Subject
  • Invitees
  • StartTime
  • EndTime
  • MeetingType
_CreateExportTransaction
  • ExportConfigGUID
_CreateExportTransactionAndData
  • ExportConfigGUID
_CreateExportTransactionAndDataByUser
  • ExportUser
  • ExportConfigProc


Required Field Rules

The Required Field business rules enable a dataform field to be completed under certain circumstances. 

MethodDescriptionParameters
_RequireFieldOnThisFormChecks for a value in a field on the current form.
  • sFieldName
_RequireTabFieldChecks for a value in a field on a related tab.
  • sTabTableName
  • sFieldName
_RequireAdHocField

Checks for a value in a field that resides in a node that is embedded in the dataform XML packet.

For example, there could be an Org node (like on the PEO Client Master), and you want to require the Source field. In that case, the parameters would be:   

  • sFieldPath:  Org/crSource   
  • sFieldLabel: Source
  • sFieldPath
  • sFieldLabel 

Core rules

In addition to the standard required field rules, two CORE rules allow for multiple trigger conditions when requiring fields. Both rules add an additional Trigger field and Trigger value in the parameter area of HE/SE_RequiredFieldEngine rule. Essentially this allows you to have multiple triggers for a required field rule.

MethodDescriptionParameters

_SE_RequireFieldOnFormOnTrigger

_HE_RequireFieldOnFormOnTrigger

Soft Error

Hard Error

  • TriggerTablemust be gen_x or #ThisForm
    • #ThisForm uses live data from the current form PRIOR to the save. 
    • gen_x evaluates the TriggerField value in the database to determine if TriggerField = TriggerValue
  • TriggerFieldmust be a valid field on Trigger Table
  • TriggerValuemust be a value or #IsEmpty
  • RequiredTable: must be gen_x or #ThisForm
    • #ThisForm uses live data from the current form PRIOR to the save.
    • gen_x evaluate the RequiredField value in the database to determine if RequiredField is populated.
  • RequiredField: must be a valid field on RequiredTable


Set Field Rules

Sometimes you want to automatically set a field value based on a set of triggering parameters; for this reason, the _SetField rules were created.

The _SetField rules provide several non-specific trigger values:

  • #IsEmpty - fires the rule if the trigger field on the trigger form has no value
  • #IsNotEmpty - fires the rule if the trigger field on the trigger form has some value - anything but empty
  • #IsDirty - fires the rule if the trigger field on the trigger form has any value other than empty and has been changed prior to save
  • #IsDirtyAndIsEmpty - fires the rule if the trigger field on the trigger form has had its value cleared prior to save
  • #IsDirtyAndNotEmpty - fires the rule if the trigger field on the trigger form has some value - anything but empty and has been changed prior to save

These options and descriptions have been added to the Context help (click the field label). The TriggerValues of this help are clickable links that fill the trigger field automatically.

MethodDescriptionParameters
_SetDateFieldValueSets a Date field on the TableName dataform.
  • sFieldName (field to be set)
  • sFieldValue (value to be entered in the field accepts datetime shortcuts (t,d,w,m,y), such as:
    • t (today),
    • 1w (+1 week)
_SetDateFieldValueFromSourceField
  • TargetField (field on form to be set)
  • SourceField (field on SourceForm to be inserted)
  • SourceForm (Dataform providing inserted value)
  • OffsetInterval
_SetFieldFromKeyThe Field Name of the field (on the Dataform Name dataform) into which the Record ID is inserted if the field is empty. Sets a Text or Integer field to that forms ID. If the field is already filled out, it does not replace the value. 
  • TargetField: The TargetField must be either a Text or Integer Input datatype. Can be used on new or existing records.
_SetFieldFromForm***

Sets a field on the TableName dataform from a field on another dataform.

Sets a field on the current single dataform from a field on a different single dataform. Must be in the same workspace. The data types must match. 

For configuration purposes, TableName is the current (target) dataform. This is to be configured for single dataforms only. Leaving the TriggerField and TriggerValue blank when configuring this rule sets the value on save of trigger dataform. If improperly configured using multi-forms, the data is set from the most recently created form, even if it is inactivated.

***Can only be used on gen_ dataforms that are not Multiforms.

  • TargetField: field on form to be set
  • SourceField: field on SourceForm to be inserted
  • SourceForm: Dataform providing inserted value
  • AllowEmptyValue: Clears the target field if SourceField is empty. When unchecked, the target field remains unchanged.
_SetFieldOnFormFromForm***

Sets a field on another dataform ( gen_DataformName) from a field on the current dataform (#ThisForm) or from another dataform (gen_DataFormName).

Sets a field on a single dataform from a different single dataform in the same workspace. This is triggered by a third, completely different single dataform in the same workspace.

The source and target data types must be the same. This is to be configured for single dataforms only. Leaving the TriggerField and TriggerValue blank when configuring this rule sets the value on save of trigger dataform. If improperly configured, when the source dataform is a multi-form, the data is set from the most recent source multiform, even if it is inactive. If the target dataform is a multiform, the data is set on the most recent multiform, even if it is inactive. 

***Can only be used on gen_ dataforms that are not Multiforms.

  • TargetField (field on the form to be set)
  • SourceField (field on SourceForm to be inserted)
  • TargetForm 
  • SourceForm (Dataform providing inserted value)
_SetFieldValueSets a field on the TableName dataform on save
  • sFieldName (field to be set)
  • sFieldValue (value to be entered in the field)
_SetFieldValueFromPattern

This rule has the ability to extract the first instance of a value from within a text field using a valid .Net RegEx pattern and set the value of another text field on the same page to this extracted value. Some .Net regex patterns found online begin with the ^ character, which must be removed when configuring this rule.

This business rule operates based on the following:

  • The SourceField value is always be treated as text
  • TargetField must be a Text data type
  • TargetField is ALWAYS overwritten with the results of the pattern match
  • SourceField and TargetField must be on the current dataform and cannot be used on tabbed forms.
  • If the pattern match returns no value, the TargetField is cleared.
  • TargetField: Text datatype
  • SourceField: text
  • Pattern
_SetImportID

_SetTabDateFieldValueSets a Date field on the sTabTableName dataform (Tab dataform associated with the triggering dataform)
  • sTabTableName (Dataform Table of Tabbed Dataform)
  • sFieldName (field to be set)
  • sFieldValue (value to be entered in the field accepts datetime shortcuts (t,d,w,m,y) such as t (today), 1w (+1 week) etc.
_SetTabFieldValueSets a field on the sTabTableName dataform on save.
  • sTabTableName (Dataform Table of Tabbed Dataform)
  • sFieldName (field to be set)
  • sFieldValue (value to be entered in the field).
_SetTabUserFieldSets a user field on the dataform tab that is a from a user field on the parent dataform of the tab. This only works from the Parent form to the Child form.
  • TabTableName (Dataform Table of Tabbed Dataform)
  • TargetField (field to be set)
  • SourceField
    • Use #CurrentUser to set the target user field to the current logged in user. 
    • Use #LoginID (with LoginID replaced by a specific user login ID) to automatically set the target user field to a specific user.)
_SetUserFieldSets a user field on the same dataform.  
  • TargetFieldIf a non-user field is selected as the TargetField, such as a text field, the importID will be set in the TargetField. 
  • SourceField
    • Use #CurrentUser to set the target user field to the current logged in user. 
    • Use #LoginID (with LoginID replaced by a specific user login ID) to automatically set the target user field to a specific user. Leaving the TriggerField and TriggerValue blank when configuring this rule sets the value on save of trigger dataform.

Primary and Secondary Trigger Fields

When configuring business rules, the Primary Trigger Field and Secondary Trigger Field lists include fields that are User datatypes.

Trigger value fields are text fields that support the following configurations:

  • A single User ID
  • #IsDirty
  • #IsEmpty
  • #IsDirtyAndEmpty
  • #IsDirtyAndNotEmpty

Primary Trigger

  • Primary Trigger Field: can specify HdrAction or a field on the current dataform
  • Primary Trigger Value: the HdrAction value or the field value used for comparison
  • Compares Primary Trigger Field HdrAction value or the dataform field value with Primary Trigger Value entered
  • The Primary Trigger Value must have changed for the rule to fire, based on the following criteria:
    • If comparing HdrAction value, the HdrAction is assumed changed
    • If comparing dataform field values (e.g., luState=MA), the dataform field must have changed
    • If #IsEmpty, #IsNotEmpty, dataform field is assumed changed
    • If #IsDirty, #IsDirtyAndIsEmpty, #IsDirtyAndNotEmpty, dataform field must have changed
  • Clicking the label brings up a list of # conditions, which are hyperlinked to set the condition in Primary Trigger Value


Secondary Trigger

Secondary trigger field and value fields are enabled when a primary trigger condition has been set and are optional

Criteria for secondary trigger conditions are as follows:

  • Primary Trigger condition must be met. Secondary Trigger acts as an AND with Primary Trigger.
  • Secondary Trigger Field: can specify HdrAction, a field on the current dataform, or a field from ServerDataProc1 or ServerDataProc2
  • Secondary Trigger Field: when using Server Data Procs, the format is SDP1.FieldName or SDP2.FieldName
  • Secondary Trigger Value: the HdrAction value or the dataform/SPD1/SPD2 field value
  • Compares Secondary Trigger Field HdrAction value or the dataform/ServerDataformProc field value with Secondary Trigger Value entered
  • The Primary Trigger Value must have changed for the rule to fire, based on the following criteria:
    • If comparing HdrAction value, the HdrAction is assumed changed
    • If comparing SDP1/SDP2 value, the current value is assumed changed
    • If comparing dataform field values (e.g., luState=MA), the current dataform field must have changed
    • If #IsEmpty, #IsNotEmpty, current dataform/SPD1/SPD2 field is assumed changed
    • If #IsDirty, #IsDirtyAndIsEmpty, #IsDirtyAndNotEmpty, dataform field must have changed
    • If #IsDirty, #IsDirtyAndIsEmpty, #IsDirtyAndNotEmpty, previous value is assumed Empty, field must have changed (contains a value)
  • Clicking the label brings up a list of # conditions, which are hyperlinked to set the condition in Secondary Trigger Value

NOTICE: You are in the old ClientSpace Help system. Please link to the new ClientSpace Help here https://extranet.clientspace.net/helpdoc/home/ClientSpace.htm