cancel
Showing results for 
Search instead for 
Did you mean: 

Event to handle DocNo. automatic population after document was added

Former Member
0 Kudos

Hi,

I have created a UDF using SAP B1 Studio with visual studio 2010.Values can enter in form and it is successfully added to table. I am trying to show the DocumentNo. automatically once document got added to the table.

i.e., DocNo. textbox in form is empty once document got added.I have tried in Buttonclick after,Data Add after...Its not working.

In which event can we handle this?

Thanks in Advance,

Parvatha Solai.N

Accepted Solutions (0)

Answers (4)

Answers (4)

edy_simon
Active Contributor
0 Kudos

Hi Parvatha,

The DocNumber is finalised by SAP when you save the document.

Hence, you cannot save this number into your UDF at the same time.

This has to be a two step process.

On After Data Add event,

    1 get the DocEntry from the pVal.ObjectKey

    2 Call up the Doc using this object key and update your UDF

          Dim oDoc As SAPBobsCOM.Documents = oCompany.GetBusinessObject(yourDocObjType)

          oDoc.GetByKey(DocEntry)

          oDoc.UserFields.Fields.Item("UDF").Value = oDoc.DocNum

          oDoc.Update

On the other hand, why would you want to save the docnum in the user field ?

Regards
Edy

Former Member
0 Kudos

Hi,

The best way is :

1) save a tick in a userfield before your adding Itempressed before action true;

2) in the same time save the tik in a public variable;

3)after saving in itempressed before action false, do a query by public tick and do all, after set nothing de public variable.

regards, Alessandro

Former Member
0 Kudos

hi.

Once added any document  u can not see that document this is object behaviors  automatically new record will come...

if u want to any thing once document is added successfully see the below link..

u can use pval.actionsuccess = true

How can i capture event after success added?

silambarasan_rajendran
Active Contributor
0 Kudos

Hi,

Try in

          et_ITEM_PRESSED  event after ActionSuccess.

If you want to make action while viewing the posted data, you have to do in

SAPbouiCOM.BoEventTypes.et_FORM_DATA_LOAD  event.

Thanks & Regards,

silambu