ValidateRow
Use this event to implement validation rules, which combine two or more cells of a row.
Syntax
<Fieldn>_ValidateRow (pTable as ISCBCdrTable, pWorkdoc as ISCBCdrWorkdoc, Row as Long, pValid as Boolean)
Parameter | Description |
---|---|
pTable | Table object for which row is to be validated. |
pWorkdoc | Current workdoc object. |
Row | Row of the table to validate. |
pValid | Parameter that contains the current valid state of the row. |
Sample Code
Private Sub MyTableField_ValidateRow(pTable as SCBCdrPROJLib.SCBCdrTable, pWorkdoc as SCBCdrPROJLib.SCBCdrWorkdoc, ByVal Row as Long, pValid as Boolean)
'check if quantity * single price = total price
Dim quantity as long
Dim s_price as double, t_price as double
'all cells must already have a valid format
quantity = CLng(pTable.CellText("Quantity", Row))
s_price = CLng(pTable.CellText("Single Price", Row))
t_price = CLng(pTable.CellText("Total Price", Row))
if quantity*s_price = t_price then
pValid = TRUE
else
pValid = FALSE
pTable.RowValidationErrorDescription(Row) = "Invalid quantity or amounts"
end if
End Sub