Hello,
I am trying to set a field in an AccpacViewList to a default value. Specifically, I am trying to set the location value to "Store" in the viewlist on the Inventory Receipts screen. I tried to set it in the DS onRecordChanging event but it doesn't seem to commit the value until after the viewlist validates the field.
Private Sub dsICREED_OnRecordChanging(ByVal eReason As AccpacCOMAPI.tagEventReason, pStatus As AccpacCOMAPI.tagEventStatus, ByVal pField As AccpacDataSrc.IAccpacDSField, ByVal pMultipleFields As AccpacDataSrc.IAccpacDSFields)
If eReason = RSN_ADDNEW Or eReason = RSN_UPDATE Or eReason = RSN_FETCH Then
If vlsICREED.GetActiveColumn = 0 Then
dsICREED.Fields("LOCATION").Value = "STORE"
'vlsICREED.ColumnIndexByField ("LOCATION")
vlsICREED.UpdateCurrentRecord (2)
vlsICREED.SaveRecord
End If
End If
End Sub
I also tried to change it in a few Viewlist events but they don't seem to be the right ones or I am not using them right.
Any ideas would be so greatly appreciated!
Thanks!
LeShel
I am trying to set a field in an AccpacViewList to a default value. Specifically, I am trying to set the location value to "Store" in the viewlist on the Inventory Receipts screen. I tried to set it in the DS onRecordChanging event but it doesn't seem to commit the value until after the viewlist validates the field.
Private Sub dsICREED_OnRecordChanging(ByVal eReason As AccpacCOMAPI.tagEventReason, pStatus As AccpacCOMAPI.tagEventStatus, ByVal pField As AccpacDataSrc.IAccpacDSField, ByVal pMultipleFields As AccpacDataSrc.IAccpacDSFields)
If eReason = RSN_ADDNEW Or eReason = RSN_UPDATE Or eReason = RSN_FETCH Then
If vlsICREED.GetActiveColumn = 0 Then
dsICREED.Fields("LOCATION").Value = "STORE"
'vlsICREED.ColumnIndexByField ("LOCATION")
vlsICREED.UpdateCurrentRecord (2)
vlsICREED.SaveRecord
End If
End If
End Sub
I also tried to change it in a few Viewlist events but they don't seem to be the right ones or I am not using them right.
Any ideas would be so greatly appreciated!
Thanks!
LeShel