Search code examples
acumatica

What code use for change id inventoryitem


I would like to use this process, but I don't know with which code to use it ? I want to change ID PRODUCTV1 to PRODUCTV2.

enter image description here

I find this function

public void ChangeCDInventoryItem(PXCache cache, string oldCD, string newCD, string type)
{
System.Collections.Specialized.OrderedDictionary keys =
new System.Collections.Specialized.OrderedDictionary(StringComparer.OrdinalIgnoreCase)
{
{
typeof(InventoryItem.inventoryCD).Name, oldCD
},
{
typeof(InventoryItem.itemType).Name, type
}
};
System.Collections.Specialized.OrderedDictionary vals =
new System.Collections.Specialized.OrderedDictionary(StringComparer.OrdinalIgnoreCase)
{
{
typeof(InventoryItem.inventoryCD).Name, newCD
},
{
typeof(InventoryItem.itemType).Name, type
}
};
cache.Update(keys, vals);
}  

Solution

  • It is much simpler, if you need a basic change ID added. Here is code that works on the LocationMaint screen:

    public class LocationMaint_Extension : PXGraphExtension<LocationMaint>
    {
        public PXChangeID<Location, Location.locationCD> ChangeID;
    }