cancel
Showing results for 
Search instead for 
Did you mean: 

Issue saving approved document drafts as document via DI API (SaveDraftToDocument).

rajo81
Member

Hi all,

I have an issue saving approved document drafts as document via DI API.

My code is: (there is a "purchase request" draft with the corresponding docEntry, thah has been approved earlier)

...

SAPbobsCOM.Documents oDocDraft = SAPbobsCOM.Documents)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDrafts);

oDocDraft.GetByKey(docEntry);

oDocDraft.SaveDraftToDocument();

...

The draft is saved successfully, but the approval gets disappeared!

The value of "WddStatus" gets "-" instead of "P", and from the OWDD table the corresponding record will be deleted!!!

(If I do it on the user Form with the "Add" button, the WddStatus gets "P" and the DocEntry in the OWDD table gets the new docEntry value, as expected.)

I assume it is an issue in the DI API. Or do I something wrong?

Thanks

janickovicpeter
Explorer
0 Kudos

Hello, I have a same problem, my Approval Request is deleted while saveing draft docuemnt, please did you find the cause ?

anne-petteroe
Community Manager
Community Manager
0 Kudos

Hello Peter,

While we're happy that you've come to SAP Community to get an answer to your question, you posted your question as an answer in an old thread.

I've converted your answer to a comment, but even so -- posting in older threads is not the best way to get guidance.

If you're looking for help, you should ask a new question: https://answers.sap.com/questions/ask.html.

Best regards,
Anne

Accepted Solutions (0)

Answers (1)

Answers (1)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Dear rajo81,

It appears that you are having the same scenario as mentioned in SAP Note 2772166.

Kindly verify the same.

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

fceylan_hs
Participant
0 Kudos

I have exact same problem as rajo81 has. But unfortunately the link you shared does not provide any solution, it's only points to the system behaviour. Whether I add the draft via .Add() or .SaveDraftToDocument() method, it does not show approved status as expected.

Also deletes the approved template.

tried with different combinations of check/uncheck of all Approval Process section in General Settings with no luck.

Any suggestion would gladly appreciated.

edward_tollenaar
Explorer
0 Kudos
I'm facing the same problem. Seems it was working in B1 V9, but no longer in B1 V10. When saving the draft as a document, I'm loosing the approval information. Anyone found a solution for this?