cancel
Showing results for 
Search instead for 
Did you mean: 

UDO afterFormDataAdd event ..

Former Member
0 Kudos

Hi , have this piece of code in an addon i'm developing ...



  [B1Listener(BoEventTypes.et_FORM_DATA_ADD, false)]
        public virtual void OnAfterFormDataAdd(BusinessObjectInfo pVal)
        {
            bool ActionSuccess = pVal.ActionSuccess;
            Form form = B1Connections.theAppl.Forms.Item(pVal.FormUID);

            // ADD YOUR ACTION CODE HERE ...

            if (ActionSuccess)
            {
                // Succeeded ..  

                String contractKey = pVal.ObjectKey; // should contain the document reference of the new Contract  .. 

Now i check my UDO in the database and my tables have been updated correctly BUT in the above the value in

my contractKey is blank ? ..

I read this in the manual:

Remarks

The event occurs only for forms connected to a business object.

The application does not send this event when the business object is modified by another application, DI action, or add-on action.

The BusinessObjectInfo.ObjectKey property returns an empty value for business objects that are not exposed in the DI API.

The BusinessObjectInfo.ObjectKey property returns an empty value in the before notification of the Add action (et_FORM_DATA_ADD).

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

In the 'onBeforeDataAdd' event I overwrite some of the info in my business object before it gets written out .. Is that the problem ?

Either that or " business object not exposed in DI API" .. Anyone know what this means ?

I'm on SAP2007A PL15 ..

Thanks

Edited by: Rob Morning on Mar 17, 2008 6:20 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Rob,

You are right, the Object key is filled only for objects which are exposed in the DI - that is why you don't get the key.

The reason for that is the format of the key which is equivalent to its representation in the DI API.

However, you can use the event and read the key value from your form.

I hope it helps,

Renana