Hello,
Version Sage v2017, Working on a custom app to insert to OE detail. The requirement is to insert a new OE line after a certain OE line. I can't get it to work. Could you please provide some pointer ?
//2017-09-21 for printing order fix
//Set where to start in order detail....
OEORD1detail1.Fields.FieldByName["LINENUM"].PutWithoutVerification(sOrderDetailLineStartFrom); // ' Line Number
OEORD1detail1.Read();
temp = OEORD1detail1.Exists;
//Then.... the back order lines
//2017-09-21
for (int i = lst_BackOrderLine.Count - 1; i >= 0; i--)
{
string sItem = lst_BackOrderLine.Component; //lstOEDetail.ItemNo;
decimal decQtyOrdered = decimal.Parse(lst_BackOrderLine.ComponentQtyInBOM);//
decimal decUnitPrice = decimal.Parse("0");
string sUnit = lst_BackOrderLine.Unit; // "1"; // lstOEDetail.PriceUnit;
string sLocation = lst_BackOrderLine.Location; // "1"; // lstOEDetail.Location;
//string sPriceList = lstOEDetail.PriceList;
//bool temp = OEORD1detail1.Exists;
OEORD1detail1.RecordClear();
temp = OEORD1detail1.Exists;
OEORD1detail1.RecordCreate(tagViewRecordCreateEnum.VIEW_RECORD_CREATE_NOINSERT); // 0
OEORD1detail1.Fields.FieldByName["ITEM"].set_Value(sItem); // ' Item
OEORD1detail1.Fields.FieldByName["PROCESSCMD"].PutWithoutVerification("1"); //' Process Command
OEORD1detail1.Process();
//OEORD1detail1.Fields.FieldByName["PRICELIST"].set_Value(sPriceList); //Price list
OEORD1detail1.Fields.FieldByName["QTYORDERED"].set_Value(decQtyOrdered); //' Quantity Ordered
OEORD1detail1.Process();
OEORD1detail1.Fields.FieldByName["PRIUNTPRC"].set_Value(decUnitPrice); //' Pricing Unit Price
OEORD1detail1.Fields.FieldByName["LOCATION"].set_Value(sLocation); //' Pricing Unit Price
OEORD1detail1.Fields.FieldByName["PRICEUNIT"].set_Value(sUnit); //' Pricing Unit of Measure
OEORD1detail1.Insert();
OEORD1detail1.Fields.FieldByName["LINENUM"].PutWithoutVerification("-1"); //' Line Number
OEORD1detail1.Read();
OEORD1detail1.RecordClear();
temp = OEORD1detail1.Exists;
OEORD1detail1.RecordCreate(tagViewRecordCreateEnum.VIEW_RECORD_CREATE_NOINSERT); // 0
}
OEORD1header.Fields.FieldByName["OECOMMAND"].set_Value("0"); //' Process O/E Command
OEORD1header.Process();
temp = OEORD1header.Exists;
OEORD1header.Update();
Version Sage v2017, Working on a custom app to insert to OE detail. The requirement is to insert a new OE line after a certain OE line. I can't get it to work. Could you please provide some pointer ?
//2017-09-21 for printing order fix
//Set where to start in order detail....
OEORD1detail1.Fields.FieldByName["LINENUM"].PutWithoutVerification(sOrderDetailLineStartFrom); // ' Line Number
OEORD1detail1.Read();
temp = OEORD1detail1.Exists;
//Then.... the back order lines
//2017-09-21
for (int i = lst_BackOrderLine.Count - 1; i >= 0; i--)
{
string sItem = lst_BackOrderLine.Component; //lstOEDetail.ItemNo;
decimal decQtyOrdered = decimal.Parse(lst_BackOrderLine.ComponentQtyInBOM);//
decimal decUnitPrice = decimal.Parse("0");
string sUnit = lst_BackOrderLine.Unit; // "1"; // lstOEDetail.PriceUnit;
string sLocation = lst_BackOrderLine.Location; // "1"; // lstOEDetail.Location;
//string sPriceList = lstOEDetail.PriceList;
//bool temp = OEORD1detail1.Exists;
OEORD1detail1.RecordClear();
temp = OEORD1detail1.Exists;
OEORD1detail1.RecordCreate(tagViewRecordCreateEnum.VIEW_RECORD_CREATE_NOINSERT); // 0
OEORD1detail1.Fields.FieldByName["ITEM"].set_Value(sItem); // ' Item
OEORD1detail1.Fields.FieldByName["PROCESSCMD"].PutWithoutVerification("1"); //' Process Command
OEORD1detail1.Process();
//OEORD1detail1.Fields.FieldByName["PRICELIST"].set_Value(sPriceList); //Price list
OEORD1detail1.Fields.FieldByName["QTYORDERED"].set_Value(decQtyOrdered); //' Quantity Ordered
OEORD1detail1.Process();
OEORD1detail1.Fields.FieldByName["PRIUNTPRC"].set_Value(decUnitPrice); //' Pricing Unit Price
OEORD1detail1.Fields.FieldByName["LOCATION"].set_Value(sLocation); //' Pricing Unit Price
OEORD1detail1.Fields.FieldByName["PRICEUNIT"].set_Value(sUnit); //' Pricing Unit of Measure
OEORD1detail1.Insert();
OEORD1detail1.Fields.FieldByName["LINENUM"].PutWithoutVerification("-1"); //' Line Number
OEORD1detail1.Read();
OEORD1detail1.RecordClear();
temp = OEORD1detail1.Exists;
OEORD1detail1.RecordCreate(tagViewRecordCreateEnum.VIEW_RECORD_CREATE_NOINSERT); // 0
}
OEORD1header.Fields.FieldByName["OECOMMAND"].set_Value("0"); //' Process O/E Command
OEORD1header.Process();
temp = OEORD1header.Exists;
OEORD1header.Update();