Custom event - update on "on before object is changed"
Hello.
Is it possible to update data on “on before object is changed”, on the inserted table ?
I was thinking to make a custom even on the INVENTORY_PART_IN_STOCK_TAB table. Before inserting the new sql line, I wanted to update the LOT_BATCH_NO field, by doing something like this :
You can achieve your requirement by calling backgound job in custom event and background job will update your Lot Batch Number, however, that update process would be performed after creation of record in Inventory Part in Stock screen.
Regards
Abdul Rehman
Hello @Abdul
Can the LOT_BATCH_NO field be updated? I made the following test on SQL Developer :
BEGIN SELECT OBJID, OBJVERSION, LOT_BATCH_NO into v_objid, v_objversion, v_lot_batch_no FROM inventory_part_in_stock_uiv where OBJKEY='F9F5CFBB88D84047B29221FE80810065';
I got these errors : ORA-20122: InventoryPartInStock.UPDATE: Field nLOT_BATCH_NO] in Inventory Part In Stock may not be modified.
ORA-06512: à "IFSAPP.ERROR_SYS", ligne 130
ORA-06512: à "IFSAPP.ERROR_SYS", ligne 707
ORA-06512: à "IFSAPP.VALIDATE_SYS", ligne 292
ORA-06512: à "IFSAPP.INVENTORY_PART_IN_STOCK_API", ligne 21659
ORA-06512: à "IFSAPP.INVENTORY_PART_IN_STOCK_API", ligne 21699
ORA-06512: à "IFSAPP.INVENTORY_PART_IN_STOCK_API", ligne 21903
ORA-06512: à "IFSAPP.INVENTORY_PART_IN_STOCK_API", ligne 2910
ORA-06512: à "IFSAPP.INVENTORY_PART_IN_STOCK_API", ligne 2918
ORA-06512: à ligne 18
No, Lot Batch No Is considered a Key in IPIS and cannot be modified.
You also cannot use Custom Events “Before” trigger for updating the data even if it’s set to “before the object is changed”, for a variety of technical reasons I won’t get into here for the sake of brevity.
That’s what I initially thought, this field cannot be updated, but I guess if we want to avoid that, we would need to review the IFS settings,
Thanks anyway
Yes, it is not possible to change record once record get created in IPIS. I was in impresstion that we can change lot/batch no like availiability control id.