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?
Edited by: garywong0224 on Mar 9, 2012 10:20 AM
Edited by: garywong0224 on Mar 9, 2012 10:21 AM
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);
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?