Hi,
when i adding Receipt for production by code
SAPbobsCOM.Documents oDocument = (SAPbobsCOM.Documents)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInventoryGenEntry);
oDocument.DocDate = DateTime.Parse("01/11/07");
oDocument.Lines.SetCurrentLine(0);
oDocument.Lines.BaseType = 202;
oDocument.Lines.BaseEntry = 5;
oDocument.Lines.Quantity = 20;
oDocument.Lines.WarehouseCode="01";
oDocument.Lines.Add();
int k=oDocument.Add();
then it is generating error
"If one of the lines is referenced to production, then all lines should be referenced"
Please help....
Regards,
Lalit Narayan
Hi Lalit,
The solution is: you should use the Lines.Add() function only if you want more then 1 line to receive!
Thus, in your example you should NOT put the Lines.Add() since it will add a second line and when you make the GR, SBO checks its empty and gives the error associated to this new empty line.
I had the same problem and realized that SBO objects works in a strange way ...
Regards,
Manuel Dias
Add a comment