Custom Event/Event Action requiring a Custom Field Value - Apps 10

  • 29 September 2023
  • 3 replies
  • 151 views

Badge +1

Hello,

I am trying to create a Custom Event using a Custom Field that has a Custom Enumeration in Apps10.

 

Freight Supplier is the custom field with the custom enumeration.  I want the custom event to trigger and be a hard stop if Charge Cost > 0 and Freight Supplier is blank and require the User to enter a value for Freight Supplier if a Charge Cost value is entered:

So I have been able to get the Custom Event to work as an Information Message and trigger when the Freight Supplier is blank however, when I click OK it saves the record without a value in the Freight Supplier field.  I can also enter the Charge Line with all the required information for Charge Cost and Freight Supplier, but it gives this message as well.

 

I have created the Custom Attribute for custom field Freight Supplier with ROWKEY at it was the only reference I coulld find:

 

I created the Event Action with following Conditions and used the Client_SYS.Add_Info in the SQL, as when trying to use error_sys.system_general option it was a hard stop and would not not me save the record even when the Charge Cost was entered and Freight Supplier custom field had a value:

Any thoughts or suggestions on how to get this custom event/event action to work as needed??


3 replies

Userlevel 7
Badge +21

Hi @rkurfman.vib ,

 

Try using the API in this example.  It should hard stop the user and not save the record.

 

Regards,

William Klotz

Userlevel 7
Badge +20

Hi @rkurfman.vib 

 

Custom fields are saved after the main record and therefore you won’t see the values in the custom fields in your event.

Therefore you need to create the event on the CUSTOMER_ORDER_CHARGE_CFT to validate the custom fields. Then the problem is accessing values in the main table since it will cause a mutation error.

You could use PRAGMA AUTONOMOUS_TRANSACTION in the event action to avoid this ;)

 

As a alternative approach, If your requirement is to make fields mandatory based on other fields, it can be also done via user/base profile using Conditional Fields.

Hope it helps :)

Damith

Badge +1

Hello william.klotz

I have tried your suggestion as follows:

But experience the below error:

 

Reply