Hello Friends,
Today I'll explain you how you can validate the newly added custom field value with database in WebCenter Forms Recognition.
As you all will be aware of how to add a custom field in Web Center Forms Recognition as I explained in my Previous Blog, if not please follow the below link
Add a Custom Field in WFR
now after adding the custom field we need to validate it with database so we need to follow the below steps as given below.
1) add a custom method as given below in userExits Script with below parameters and provide the proper value for the input parameters.
Public Function xxValidateCustomFieldValue(ByVal pWorkdoc As SCBCdrPROJLib.ISCBCdrWorkdoc, ByVal pStrSQLGroup As String, ByVal pstrDBTable As String, pstrDBField As String, ByVal pstrDocField As String, ByVal rowIndex As Long, Optional ByRef lngCount As Long) As Boolean
' logic to validate the field Value
End Function
validation script
2) call the above method from the UserExitDocumentValidate method as below
Public Sub UserExitDocumentValidate(pWorkdoc As SCBCdrPROJLib.ISCBCdrWorkdoc, pValid As Boolean)
for Forms Header Fields
Dim blnSuccess As Boolean
blnSuccess = xxValidateFieldValue(pWorkdoc, "connectionStringValue(ex 01,02)", "DB_TABLE_NAME", "DB_FIELD_NAME","FormFieldName")
For Forms Table Line Items Fields
Dim blnSuccess As Boolean
Dim i As Long
For i = 0 To pWorkdoc.Fields("LineItems").Table(0).RowCount -1
blnSuccess = xxValidateFieldValue(pWorkdoc, "01", "DB_TABLE_NAME", "DB_FIELD_NAME", "FormFieldName", i)Next
End Sub
That's it thanks for visiting the blog
Today I'll explain you how you can validate the newly added custom field value with database in WebCenter Forms Recognition.
As you all will be aware of how to add a custom field in Web Center Forms Recognition as I explained in my Previous Blog, if not please follow the below link
Add a Custom Field in WFR
now after adding the custom field we need to validate it with database so we need to follow the below steps as given below.
1) add a custom method as given below in userExits Script with below parameters and provide the proper value for the input parameters.
Public Function xxValidateCustomFieldValue(ByVal pWorkdoc As SCBCdrPROJLib.ISCBCdrWorkdoc, ByVal pStrSQLGroup As String, ByVal pstrDBTable As String, pstrDBField As String, ByVal pstrDocField As String, ByVal rowIndex As Long, Optional ByRef lngCount As Long) As Boolean
' logic to validate the field Value
End Function
validation script
2) call the above method from the UserExitDocumentValidate method as below
Public Sub UserExitDocumentValidate(pWorkdoc As SCBCdrPROJLib.ISCBCdrWorkdoc, pValid As Boolean)
for Forms Header Fields
Dim blnSuccess As Boolean
blnSuccess = xxValidateFieldValue(pWorkdoc, "connectionStringValue(ex 01,02)", "DB_TABLE_NAME", "DB_FIELD_NAME","FormFieldName")
For Forms Table Line Items Fields
Dim blnSuccess As Boolean
Dim i As Long
For i = 0 To pWorkdoc.Fields("LineItems").Table(0).RowCount -1
blnSuccess = xxValidateFieldValue(pWorkdoc, "01", "DB_TABLE_NAME", "DB_FIELD_NAME", "FormFieldName", i)Next
End Sub
That's it thanks for visiting the blog
Good one....
ReplyDeleteHow do we test this code
ReplyDelete