Tuesday, 6 December 2011

Process Else Rules - Accessing the DataObject in Code

Within the Code tab of a Process, the Base Object can be accessed as a property. For example, the evaluation of CUSTOM rules can sometimes require a decision to be made based on a value contained within the Base Object.
Access to the ProfMaster Base Object from a custom rule in Process code
Function Evaluate As System.Boolean
Return Me.IM_AutoBillEdit.IsOutsideProcess.Value(False)
End Function

However, this Base Object property is not accessible in Else rules. To access it, cast Me.Process to its type and then access individual objects though the object collection.
Access to the ProfMaster Base Object from an ELSE rule in Process code
Public Overrides Sub OnRule()
For Each profMasterItem As ProfMaster In _
CType(Me.Process, NextGen.Application.Process.ProfProcess). _
ProfMasterCollection

NextMessage = profMasterItem.Description
Next
End Sub

No comments:

Post a Comment