Skip to Content
avatar image
Former Member

Event to handle DocNo. automatic population after document was added

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Sep 18, 2014 at 10:27 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 18, 2014 at 11:11 AM

    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?

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 18, 2014 at 03:58 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 19, 2014 at 03:20 AM

    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

    Add comment
    10|10000 characters needed characters exceeded