Solved

Custom event before receiving purchase order arrival

  • 13 February 2023
  • 2 replies
  • 220 views

Badge +1

Hi,

 

I am trying to create a before custom event (apps9) to check the expiry date entered by the user before the receive order dialog can finish.

 

Does anyone know what view I need to set the custom event on for this to work? 

icon

Best answer by Kanishka Dilana 14 February 2023, 10:20

View original

2 replies

Userlevel 6
Badge +15

Hi @nstacktk,

I think you’ll need to create the Custom Event against the LU ReceiptInventoryLocation, and Table RECEIPT_INVENTORY_LOCATION_TAB. But, when writing the validation, you’ll have to fetch the Expiration Date using the method,

IFSAPP.Inventory_Part_In_Stock_API.Get_Expiration_Date(contract, part_no, configuration_id, location_no, lot_batch_no, serial_no, eng_chg_level, waiv_dev_rej_no, activity_seq)

Because Expiration Date is not saved against above SQL Table as a separate Column.

However, such validation will only work when you press the ‘OK’ button in Receipt dialog. Anyway, can you tell me what exact validation/check you are trying to perform using the Expiration Date, so that I can give you a more specific answer than this?

Sametime, If you just want to make it (I.e. Expiration Date) Mandatory, you can simply add a ‘Minimum Durability Days’ value against your Inventory Part (Use a None Zero value of your choice and system will Calculate a Default Expiration Date based on that. The user can change the Default Date value when in the Receipt dialog, etc. but if he/she set it as NULL, then system will use the Minimum Days Value in Calculating Closest Expiration Date possible).

 

However, one thing I’ve noticed was that, if you set the above ‘Minimum Durability Days’ value as ‘0’, then the system will give below error unless user changes the Default Date to a Future Date when in the Receipt dialog. Moreover, the same error will be presented if he/she set it as NULL. So, if your requirement is to make it the Expiration Date Mandatory/Not NULLable, then setting the  ‘Minimum Durability Days’ value as ‘0’ will provide you not ideal, but a workable solution I should say,

 

 

Badge +1

Hi @nstacktk,

I think you’ll need to create the Custom Event against the LU ReceiptInventoryLocation, and Table RECEIPT_INVENTORY_LOCATION_TAB. But, when writing the validation, you’ll have to fetch the Expiration Date using the method,

IFSAPP.Inventory_Part_In_Stock_API.Get_Expiration_Date(contract, part_no, configuration_id, location_no, lot_batch_no, serial_no, eng_chg_level, waiv_dev_rej_no, activity_seq)

Because Expiration Date is not saved against above SQL Table as a separate Column.

However, such validation will only work when you press the ‘OK’ button in Receipt dialog. Anyway, can you tell me what exact validation/check you are trying to perform using the Expiration Date, so that I can give you a more specific answer than this?

Sametime, If you just want to make it (I.e. Expiration Date) Mandatory, you can simply add a ‘Minimum Durability Days’ value against your Inventory Part (Use a None Zero value of your choice and system will Calculate a Default Expiration Date based on that. The user can change the Default Date value when in the Receipt dialog, etc. but if he/she set it as NULL, then system will use the Minimum Days Value in Calculating Closest Expiration Date possible).

 

However, one thing I’ve noticed was that, if you set the above ‘Minimum Durability Days’ value as ‘0’, then the system will give below error unless user changes the Default Date to a Future Date when in the Receipt dialog. Moreover, the same error will be presented if he/she set it as NULL. So, if your requirement is to make it the Expiration Date Mandatory/Not NULLable, then setting the  ‘Minimum Durability Days’ value as ‘0’ will provide you not ideal, but a workable solution I should say,

 

 

Thanks for that.

What I needed to do is check the expiration date and then check a custom check box on the inventory part that forces the user the add an expiration date if the checkbox is checked. 

I have the error message working now for that screen but the same error that should show on the wadaco screen when registering Purchase Order Arrivals doesn’t display the error.

Is there something I can do to get it to show the same error message? Currently I am using  “raise_application_error(-20101,'No Expiry Date Entered');”

Reply