Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

UDO afterFormDataAdd event ..

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

Former Member
Not what you were looking for? View more on this topic or Ask a question