cancel
Showing results for 
Search instead for 
Did you mean: 

How to know if created document is a draft

Former Member
0 Kudos

Hi, I'm creating a Sales Order through DI API. If the document does not have discount it add's it directly to SAP. If it has a discount it goes through an approval process in SAP and it is created as a Draft.

When I execute the .Add() procesude for the document, how can I determine if a draft was created or a final document?

Accepted Solutions (1)

Accepted Solutions (1)

edy_simon
Active Contributor

Hi Youval,

Use the

      ObjectType = oCompany.GetNewObjectType();

method to get the newly created object type.

If the ObjectType = 112, it is a draft created.

Regards

Edy

m_felicella
Participant
0 Kudos

Many thank's.

Best regards

Answers (3)

Answers (3)

moshenaveh
Community Manager
Community Manager
0 Kudos
maik_delly
Active Contributor
0 Kudos

Hi Youval,

after adding the document, call SBO_Company.GetNewObjectType() -> if it returns 112 you got a draft.

regards,

Maik

Former Member
0 Kudos

hi.

u can check it in database....

using record count...

before pressing the add.

check the total records then

after add again check it in data base records.

i think odrf....table...