Solved

purchase part event action

  • 6 May 2024
  • 1 reply
  • 35 views

Badge +5
  • Do Gooder (Customer)
  • 9 replies

dear all, 

we want to create an event below.I need a SQL query and steps to create this. I would be very happy if you could explain it step by step as I am a beginner.

When a purchase request is created for purchasing materials with a standard package size larger than 1, we want the user to receive a warning on the screen: 'You can only enter the quantity in x (standard package size) or its multiples of the purchased material.

 

icon

Best answer by Gonzalo 7 May 2024, 18:43

View original

1 reply

Userlevel 3
Badge +8

Hi Sevim.

You will need a combination of a Custom Event + a Online SQL action.

First you need to locate the form you want to work with. Example:

 

Get the System Info view open to locate the Logical Unit. In this case:

 

 

The Logical Unit PurchaseReqLinePart is the one holding the Custom Event which should trigger when a new record is created.

 

Create a new Custom Event here:

 

 

 

You need to select carefully the table on which you want to place the Event. To make sure you are in the right place, it is good to have access to the database and check if the info you have just created is there.

 

Select the attributes that you may want to check in the Event Action; you can use new, old or both values. It is possible to add some Custom Attributes that you might want. For example, if you want to get some specific information from Supplier for Purchase Part and there is a Get function for that, it’s easy to add here.

Then complete the Action:

 

 

In your case, the recommended approach is to use a Online SQL code which will do the relevant checks and raise an error if the conditions are met. The way to raise an error is by using Error_Sys.Record_General(lu_name_, ‘ERRORIDENTIFIER: Your error message here :P1, param1_). If you want to support errors in different languages you will have to handle it manually using a CASE statement.

 

You can find more detailed information here:

https://docs.ifs.com/techdocs/foundation1/040_administration/240_integration/320_events/default.htm

 

Please note that Online SQL actions require some programming experience with Oracle PLSQL and being familiar with IFS business logic code.

 

Thank you much.
Best regards.
Gonzalo.

 

 

 

Reply