cancel
Showing results for 
Search instead for 
Did you mean: 

SerialAndBatch sample. Error message: You should use existing serial/batch numbers for this document type

Former Member
0 Kudos

Hi all.

I have a problem creating serial number. this is SerialandBatch sample from SDK.

But it does not create Serial number for item. It always shows You should use existing serial/batch numbers for this document type.

The error appears here:

globalD.RetVal = globalD.oInvGenEntry.Add();

I can do it in client. When I create Goods Issue, after clicking Add button, I write serial numbers.

But in sample it does not work for me. what is wrong ? Help to solve please.

Thanks in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

edy_simon
Active Contributor
0 Kudos

Hi Kamil,

Can you show us your declaration of oInvGenEntry object ?

Regards
Edy

Former Member
0 Kudos

Hi Edy,

it is written like that:

globalD.oInvGenEntry = (SAPbobsCOM.Documents)globalD.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInventoryGenEntry);

edy_simon
Active Contributor
0 Kudos

Hi Kamil,

Good Receipt should not throw you this error.

Can you export out your document before you add it,

And visually look at the xml file, just make sure that everything is ok ?

If it is, I recommend you to clear up the temp folder and or re-install your DI API.

Regards

Edy

Former Member
0 Kudos

Hi Edy, it does not help me.

Please look at this sample in sdk, check if it works for you.

edy_simon
Active Contributor
0 Kudos

Hi Kamil,

I have never encounter this problem with this document type.

Can you attach the xml generated here and I will load this XML and test it.

Regards

Edy

Former Member
0 Kudos

thank you for your reply, Edy

I dont understand, which xml do you want?

edy_simon
Active Contributor
0 Kudos

Hi Kamil,

Before this line :

globalD.RetVal = globalD.oInvGenEntry.Add();

Add below line

globalD.oInvGenEntry.SaveXML("C:\\MyTestFile.xml")

Grab the exported XML file and post it here

Regards
Edy