2 Replies Latest reply: Mar 9, 2012 1:51 AM by Owen Slater RSS

how to get dockey

Gary Wong
Currently Being Moderated

Hi all,

Anyone know how to get the docentry or docnum?

 

I successfully add the draft through DI API. After user click the ADD button, the draft will be added. Then, I like to link that ODRF.DocEntry  to the field in my user defined object.

 

What number is the docentry which the user just added?

 

How can I approach it?

Thanks

Gary

 

Edited by: garywong0224 on Mar 9, 2012 10:20 AM

 

Edited by: garywong0224 on Mar 9, 2012 10:21 AM

  • Re: how to get dockey
    Owen Slater
    Currently Being Moderated

    Hi Gary,

     

    There's a method in the DI API Company object that returns the key value of the last object you added (in your current DI API session). For a marketing document it will return the DocEntry. If you need the DocNum then you'll have to query the appropriate header table using a recordset object based on the DocEntry you've been given.

     

    string docEntry = "";
    sbo.Company.GetNewObjectCode(out docEntry);

     

    Kind Regards,

     

    Owen

    • Re: how to get dockey
      Gary Wong
      Currently Being Moderated

      Hi Owen

      Thx for reply and could you please mention what is the docentry?

      I using VBA

      the code I write as follow:

       

      Dim outdocentry As String

       

      MsgBox ("Credit Note DRAFT Added " & oCompany.GetNewObjectCode(out docentry))

       

      but (out docentry) was fault. how can I manage the coding in VBA?

      thanks

      Gary

Actions