Skip to Content
0
Former Member
Aug 05, 2008 at 08:50 AM

How to get object key before load data into form?

499 Views

I need to get object key (e.g. ItemCode in Item Master Data From ,docEntry in A/R Invoice From) to calculate and do something before data is loaded into this form .

I try to use SAPbouiCOM.BusinessObjectInfo.objectKey as in this code.

Private Sub oApp_FormDataEvent(ByRef pVal As SAPbouiCOM.BusinessObjectInfo, ByRef BubbleEvent As Boolean) Handles oApp.FormDataEvent

If pVal.FormTypeEx = "672" And pVal.BeforeAction = True And pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_DATA_LOAD Then

oApp.MessageBox(pVal.ObjectKey)

End If

End Sub

But this fields doesn't valid under this condition (form DI help file).

- The property returns an empty value in the before notification of the Load action (et_FORM_DATA_LOAD) triggered by a Find operation.

How can I get this value(key)?