Skip to Content

SAP B1: Issue with create a delivery with Assembly BOM item link to a Sales Order

Hi Experts!


I got an error: "Cannot add row without complete selection of batch/serial numbers"

when I try to create a delivery with BOM assembly item and Batch numbers by DI API.

Could you please give me some advises?

item2 is managed by butch numbers.

Here's my code:

oDelivery = (Documents) Program.dossier.GetBusinessObject(BoObjectTypes.oDeliveryNotes);
oDelivery .CardCode = "C0000";
oDelivery .DocDueDate = DateTime.Now;

oDelivery .Lines.BaseType = 17;
oDelivery .Lines.BaseEntry = 444;
oDelivery .Lines.BaseLine = 0;
oDelivery .Lines.Quantity = 10;
oDelivery .Lines.BatchNumbers.BatchNumber = "TEST01";
oDelivery .Lines.BatchNumbers.Quantity = 20;
int result = oDelivery .Add();

if (result != 0)
     Program.SBO_Application.MessageBox("Error : " + result.ToString() + "--" + Program.dossier.GetLastErrorDescription()); 

Thank you very much in advance.

Oussama

1.jpg (134.8 kB)
2.jpg (126.0 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Aug 22, 2016 at 03:54 PM

    Hi Oussama,

    I had a similar discussion regarding this topic here

    It seems this DI is missing this cases, I mentioned a workaround but since you have an Assembly item I believe it won't help you unless you can change your item type.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.