Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inserting BOM/Kit Components to OEORDD

Status
Not open for further replies.

nztankgirl

Programmer
Apr 22, 2010
10
0
0
NZ
Hi,

Am trying to add a BOM item to an order using the COMAPI but for some reason it's not updating the components correctly.

If I look in the SQL database the lines have been correctly inserted into the OEORDDD table but the LINENUM is 1,2,3 etc instead of 32,64 - if I manually update these the lines appear in the Kitting Components screen.

What am I missing?

Thanks
 
In OE, a BOM item should look no different than a regular item. If you mean Kit items, maybe there's something wrong with your code, and without seeing it nobody can tell you much more.
 
I have just included the code relating to the KIT/BOM stuff – I initialize all the views etc as per the macro created in Accpac.

//kit / bom / none
sResult = SetDetailValue(LINE_DETAILS.DDTLTYPE, "DDTLTYPE");
if (sResult.Trim() != "") return sResult.Trim();

if (LINE_DETAILS.DDTLTYPE != "0")
{
sResult = SetDetailValue(LINE_DETAILS.DDTLNO, "DDTLNO");
if (sResult.Trim() != "") return sResult.Trim();
}


value = "1";
_order_detail_1.Fields.get_FieldByName("PROCESSCMD").set_Value(ref value);
_order_detail_1.Process();
_order_detail_1.Insert();

if (LINE_DETAILS.DDTLTYPE != "0")
{
//_order_detail_9.Fields.get_FieldByName("LINENUM").set_Value(ref line_Num);
_order_detail_9.Browse("", true);
_order_detail_9.Fetch();
obj = "-2147483647";
_detail_fields_9.get_FieldByName("PRNCOMPNUM"). PutWithoutVerification(ref obj);
_detail_fields_9.get_FieldByName("COMPNUM").PutWithoutVerification(ref obj);
_order_detail_9.Browse("", true);
_order_detail_9.Fetch();
}

value = "1";
_order_header.Fields.get_FieldByName("GOCHKCRDT").set_Value(ref value);
value = "1";
_order_header.Fields.get_FieldByName("PROCESSCMD").set_Value(ref value);
_order_header.Process();
if (!update) _order_header.Insert(); else _order_header.Update();
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top