cancel
Showing results for 
Search instead for 
Did you mean: 

How to get object key before load data into form?

Former Member
0 Kudos

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)?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

HI

I think beforeAction you are unale to the DocEntry (ABSENTRY) value.You will not know what will be the Entry for loading.

I am suggesting to do it after data loaded (calculcation) and manupulation before you save into the database.

After data load, you can also read this, or try to access the 0 index of dbdatasource tables. (always the main.-head) table.

Items also has a DocEntry fields, which is the also a running number as docentry is marketing documents(B1 standard).

Regards

Janos.

Edited by: Janos Nagy on Aug 5, 2008 1:13 PM

Former Member
0 Kudos

Janos

I can't do a calculation after data is loaded because what I'm going to do is that if the opening entry match my condition , the system will not let that user see that entry (bubbleEvent = False).

I think when formDataEvent is triggered B1 know which entry are going to load because before this event is triggered we did one of following ways

1. choose from "choose from list windows"

2. enter docEntry or itemCode or cardCode and then press Find Button

3. press "next/previous record button"

4. press linked button (orange arrow)

Choice 3 and 4 can be done by retrieve data from BusinessObjectInfo.objectKey (I've tested and it return entry key that is going to open correctly).

but 1 and 2 can't (it return empty as I mention before).

thanks

Edited by: daron tancharoen on Aug 5, 2008 2:34 PM