Skip to Content
0
Former Member
May 03, 2013 at 08:19 PM

I can´t update series field in SAPbobsCOM.Documents

34 Views

Hi,

I´m using DI API 8.81 to créate new sale order, all work fine but I have a problema with series field, the value that I´m traying to

assign is 6, but the API is assigning -1, in database.

Somebody have idea why the series field can´t assign it?

Thanks.

int lRetCode;

int lErrCode = 0;

string sErrMsg = "";


// Init the Order object

MainModule.oOrder = (SAPbobsCOM.Documents)MainModule.oCompany.GetBusinessObject SAPbobsCOM.BoObjectTypes.oOrders);

MainModule.oOrder.CardCode = "14154";

MainModule.oOrder.HandWritten = SAPbobsCOM.BoYesNoEnum.tYES;

MainModule.oOrder.DocNum = System.Convert.ToInt32("500902");

MainModule.oOrder.DocDate = DatePosting.Value;

MainModule.oOrder.DocDueDate = DateDelivery.Value;

MainModule.oOrder.Series = System.Convert.ToInt32("6"); //<-<-<-<-<-<-< Series

MainModule.oOrder.Lines.ItemCode = "BAR 214";

MainModule.oOrder.Lines.Quantity = System.Convert.ToDouble(1);

MainModule.oOrder.Lines.TaxCode = "A4";

MainModule.oOrder.Lines.SerialNum = "6";

MainModule.oOrder.Lines.WarehouseCode = "03";

MainModule.oOrder.Lines.Add();


lRetCode = MainModule.oOrder.Add(); // Try to add the orer to the database

if (lRetCode != 0)


{


int temp_int = lErrCode;

string temp_string = sErrMsg;

MainModule.oCompany.GetLastError(out lErrCode, out temp_string);

MessageBox.Show(lErrCode + " " + sErrMsg); // Display error message


}


else


{

MessageBox.Show("Order Added to DataBase");

}