Skip to main content

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 :

&NEW:LOT_BATCH_NO:=REPLACE(&NEW:LOT_BATCH_NO, ‘-*-*-1’, ‘’);

Thanks

IFS APP 10 UPD 5

Hi @romsar 

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 :

DECLARE  v_info varchar2(32000); attr_ varchar2(32000); v_objid varchar2(32000); v_objversion varchar2(32000); v_lot_batch_no varchar2(500); v_lot_batch_no_new varchar2(500);

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';     

        -- v_lot_batch_no = 48864-*-*-1
    v_lot_batch_no_new:=REPLACE(v_lot_batch_no, '-*-*-1', '');          Client_SYS.Clear_Attr(attr_);     CLIENT_sys.Add_To_Attr('LOT_BATCH_NO',v_lot_batch_no_new,attr_);     ifsapp.Inventory_Part_In_Stock_API.Modify__(v_info, v_objid, v_objversion, attr_, 'DO'); END;

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.


Reply