Sage 300 v2014. Need to put together a simple custom OE screen. When an item is entered, if it is in a list of items, then set the item # field to be a "DefaultItem". I am using Detail View OnRecordChanging event to detect the change, which is good, but I can't set the item # using a value. What did I do wrong? Highly appreciate your input.
Private Sub vDView_OnRecordChanging(ByVal eReason As AccpacCOMAPI.tagEventReason, pStatus As AccpacCOMAPI.tagEventStatus, ByVal pField As AccpacDataSrc.IAccpacDSField, ByVal pMultipleFields As AccpacDataSrc.IAccpacDSFields)
Dim strItem As String
Dim bolItemFound As Boolean
If eReason = RSN_FIELDCHANGE Then
If pField.Name = "ITEM" Then
strItem = pField.UncommittedValue
MsgBox strItem
bolItemFound = ItemExists(strItem) 'check if the item keyed is in the list
If bolItemFound = True Then
MsgBox "Found"
'vDView.Fields("ITEM").Value = "DefaultItem" <--- This line does not work
End If
End If
End If
End Sub
Private Sub vDView_OnRecordChanging(ByVal eReason As AccpacCOMAPI.tagEventReason, pStatus As AccpacCOMAPI.tagEventStatus, ByVal pField As AccpacDataSrc.IAccpacDSField, ByVal pMultipleFields As AccpacDataSrc.IAccpacDSFields)
Dim strItem As String
Dim bolItemFound As Boolean
If eReason = RSN_FIELDCHANGE Then
If pField.Name = "ITEM" Then
strItem = pField.UncommittedValue
MsgBox strItem
bolItemFound = ItemExists(strItem) 'check if the item keyed is in the list
If bolItemFound = True Then
MsgBox "Found"
'vDView.Fields("ITEM").Value = "DefaultItem" <--- This line does not work
End If
End If
End If
End Sub