Question

Restrict Customer Address Field to LOV (IEE)

  • 19 October 2023
  • 1 reply
  • 27 views

Badge +1

I am looking to restrict users to having to utilize the list of values when entering a customer’s address in the General Address Info on the Customer Record.

Right now, the IFS native field is both free type and has the option to use the list of values.

Is there a way to lock the field so that it is no longer free type - and users HAVE to use the list of values?

 

Any help here is much appreciated

 

 


1 reply

Userlevel 2
Badge +8

Hi,

 

I don't think its possible to restrict that field’s free entry without a modification, however if you would like to just restrict the users from entering values that are not in the LOV list then this can be achieved with a small custom event and action. See steps below.

 

  1. First create a custom event for the CustomerInfoAddress LU, CUSTOMER_INFO_ADDRESS_TAB table that only runs on object changes and when the STATE column is changed. Make sure to select the STATE attribute’s New Value column in the list of attributes.

 

  1. Next create a custom action of type “Execute Online SQL” and make sure the “Perform upon Event” field matches the “Event ID” field above. Set the “SQL Statement” value to the one below.

DECLARE
   dummy_ NUMBER;
   CURSOR chk_state_exists_ IS
      SELECT 1
      FROM STATE_CODE_LOV
      WHERE state_code =  '&NEW:STATE';
BEGIN
   OPEN chk_state_exists_;
   FETCH chk_state_exists_ into dummy_;
   IF (chk_state_exists_%NOTFOUND) THEN
      CLOSE chk_state_exists_;
      Error_SYS.System_General('CINVALIDSTATE: "' || '&NEW:STATE' || '" is not a valid state');
   END IF;
   CLOSE chk_state_exists_;
END;

 

Now each time the user saves the address change on the Customer form using a value that is not in the LOV list it will present the error specified in the “Error_SYS.System_General” line.

 

 

Regards

 

Telha

Reply