This site is currently read-only as we are migrating to Oracle Forums for an improved community experience. You will not be able to initiate activity until January 31st, when you will be able to use this site as normal.

    Forum Stats

  • 3,890,899 Users
  • 2,269,649 Discussions


Sum of items validation in form

User_EY4V5 Member Posts: 4 Green Ribbon

Hello. I just stared with APEX.

I have a form where a user can choose 1 value from a Popup LOV. Next to it is a number field where the user writes the quantity he wants to get from said item (max value is 5 in the number field. I have that type of form 5 times in the same page.

My request is to create a validation that makes sure that the total quantity of all items is less than 3

Thanks in advance

Best Answer

  • Hamza Al-abbasi
    Hamza Al-abbasi Mid-level Oracle APEX Developer Member Posts: 873 Bronze Crown
    edited Sep 17, 2022 2:00PM Answer ✓

    Create a validation with type "Expression" and set Language to "PL/SQL". In PL/SQL Expression write this expression :

    (:PX_ITEM1 + :PX_ITEM2 + :PX_ITEM3 + :PX_ITEM4 + :PX_ITEM5) < 3