on 10-15-2008 5:17 AM
Hi, all,
I want to update a Draft document of A/P Invoice, but I have no idea what is the Key Code.
Here is my code:
Dim oDoc As SAPbobsCOM.Documents
oDoc = oCompany.GetBusinessObject(BoObjectTypes.oDrafts)
oDoc.DocObjectCodeEx = BoObjectTypes.oInvoices
oDoc.GetByKey( ????? )
I tried to use DodNum, but can't get the right record.
Please advise.
Thanks
Dear hkcm,
Yes you need to copy field by field.
Best Regards
Jane Jing
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Jane,
Thanks for your reply.
Would you please tell me how to copy the draft to Invoice?
Can it be copied by a recordset, or I need to copy field by field?
After I copy the draft to Invoice, is the Draft document retained in the database?
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear hkcm,
You need to create a new Invoice document, copy the date from draft to invoice then add the invoice.
Best Regards
Jane Jing
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks all,
I can loaded the Draft document and modify the content with oDoc.Update.
How to Add (Save) the Draft as offical AP Invoice?
I've tried oDoc.Add but didn't work.
Pls adv., thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear hkcm,
Please use DocEntry property for oDoc.GetByKey method.
You could use following query to get the DocEntry of a draft
SELECT DocEntry, * FROM odrf
Best Regards
Jane Jing
SAP Business One Forums team
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In the getbykey u need to pass the DocEntry.
Vasu Natari.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
Dim oDoc As SAPbobsCOM.Documents
oDoc = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDrafts)
oDoc.DocObjectCode = SAPbobsCOM.BoObjectTypes.oInvoices
oDoc.GetByKey()
for DRAFT=112
for INVOICES=13
regards,
varma
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.