cancel
Showing results for 
Search instead for 
Did you mean: 

et_FORM_DATA_ADD event

Former Member
0 Kudos

I have performed certain calculations when a record is added in A/R invoice.I have called the function on the et_FORM_DATA_ADD event as,


If BusinessObjectInfo.EventType = SAPbouiCOM.BoEventTypes.et_FORM_DATA_ADD And (BusinessObjectInfo.FormTypeEx = "133") And BusinessObjectInfo.ActionSuccess = True Then
 SaveStockTrans()
End If

Usually the event fires once but sometimes it fires twice.I can not predict when it fires twice.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Dilip,

Since you have the problem with this Form Data Add event and not able to monitor the bizarre occurrence, I suggest you use the Item_Pressed event, Item UID = "1" and Before_Action = False. That is more reliable and will ease out the pain area you are facing.

Hope this helps.

Regards,

Satish.

Former Member
0 Kudos

I tried item press event but if some fields are missing then also the event fires.For eg,if tax code is missing then the record can not be added.In this situation the item press event gets fired first and then the error occurs.I want to execute function only if new entry is added.

Former Member
0 Kudos

Hey Dilip,

Thats indeed true. But, you need to actually have the validation, before hand. I guess you will be sure on what your mandatory fields are. So, you get the validations handled first and then, make it fool proof, such that finally, the event is handled.

Regards,

Satish.

Answers (1)

Answers (1)

Former Member
0 Kudos

Dear Dilip Kumbhar,

Do you add the code

BusinessObjectInfo.BeforeAction = false

to filter the event?

Is there any approval defined for the document?

I found if the document is need to be approval then it may trigger twice FORM_DATA_ADD event.

Best Regards

Jane Jing

SAP Business One Forums team

Former Member
0 Kudos

Dear Jane Jing,

There is no approval for the document.I am adding A/R invoice and it prompts just like other invoices.