on 2019 Mar 19 10:07 AM
Hi folks,
I get the draft invoice in this way:
SAPbobsCOM.Documents oDoc = Company.GetBusinessObject( SAPbobsCOM.BoObjectTypes.oDrafts );
oDoc.GetByKey( docEntry );
Now, I want to check if object oDoc represetns draft or regular document.
After method GetByKey() property DocObjectCodeEx (and DocObjectCode too) return value 13 (and oInvoice).
Hi Przemyslaw,
I see the issue. Never came across this scenario myself.
Do you at least know if all the documents are based on a Draft? If they do, you can use the 'draftkey' property to distinguish the - all Drafts have draftkey = -1 and all documents based on a draft will have a value other than -1. Again, this logic will only work if you know for sure all the documents are based on Drafts.
Hope it helps,
Vitor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vieira,
I dont know nothing about documents I get - that the point. But You pushed my thoughts to solution, that is not optimal but works. I will try to create object with the same ObjType and DocEntry as the object from array has. If it fails = this was draft.
bool IsDraft( SAPbobsCOM.Documents oUnknownDocument )
{
SAPbobsCOM.Documents oTestDocument = Company.GetBusinessObject( oUnknownDocument.DocObjectCode );
return oTestDocument.GetByKey( oUnknownDocument.DocEntry );
}
User | Count |
---|---|
105 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.