cancel
Showing results for 
Search instead for 
Did you mean: 

how to get dockey

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member201110
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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