For background, we have custom feature provided by our consultant to duplicate released product item along with its formula & routing.
it help our Engineering to makes new item as our material is quite common yet our formula use alot of material & the different between product is just a minor. When we copy a Finish Good product, it also copy all the Pegged Supply type item in the formula into new item along with its formula & routing.
in there, we also had our custom field in Invetttable for our internal coding/naming that also copied when we duplicate a product.
So here the case.
our current custom field for our coding/naming use numeric data type. Today we need Character on those custom field. so, i rename the old field & makes new field with string data type & the same name as the old one. i also had adjust some other table, report, & module related to it, doing sync to each affected table, & full cil. most of the module, report already function as intended, it show the new character value naming.
my current problem right now is on the custom duplicate module i mention above. When im duplicating a finish goods product consist of 10 pegged supply type item, it create the a new finish good item & 10 new item as in the pegged supply list as intended but on my custom field, not all copied to the new item. some of them have the copied value, while some others just having 0 value. it happen on random occurence as when i try to diplicate the same item again, i will get different result of which item that get 0 value on my custom field. I have try to debug it, but found nothing. all parameters input is good but as insert() command executed & i check the inserted data, for some reason the inserted value become 0. up to this time, all parameter value on debug mode still good & didnt show any sign it change to 0.
InventRNDProductTable.CategoryItem = InventTable.CategoryItem;
InventRNDProductTable.SubCategoryItem = InventTable.SubCategoryItem;
InventRNDProductTable.TypeItem = InventTable.TypeItem;
InventRNDProductTable.InventSiteId = InventTable.SiteId;
InventRNDProductTable.PurchUnitId = "";
InventRNDProductTable.PurchTaxItemGroup = "";
InventRNDProductTable.Weight = InventTable.NetWeight;
InventRNDProductTable.Model = strFmt("%1%2","XXX-",InventTable.Model); <<<i purposely add this XXX to ensure if this code is the one that used on the duplicate action & it does.
InventRNDProductTable.Formula = InventTable.Formula;
InventRNDProductTable.ProdPoolId = InventTable.ProdPoolId;
InventRNDProductTable.PartName = InventTable.PartName;
InventRNDProductTable.SchemaNoInt = strFmt("%1%2","XXX",InventTable.SeqNoInt); <<<Issued value not copied on random occurence
InventRNDProductTable.CustInit = InventTable.CustInit;
InventRNDProductTable.AutomaticPart = InventTable.AutomaticPart;
InventRNDProductTable.BatchNumGroupId = InventTable.BatchNumGroupId;
InventRNDProductTable.DefaultDimension = InventTable.DefaultDimension;
InventRNDProductTable.insert();
I have try to do Full CIL, sync all table but the problem still occuring. Im kinda clueless right now.
is there something i miss here?
Thanks.