Skip to main content
priyankam7887
March 31, 2022
Question

Restrict user to add "3rd" entry if capacity is 2

  • March 31, 2022
  • 1 reply
  • 0 views

Hi,

I have 2 tables pen and animal table , when i am adding the animal i am assigning the pen to the animal and the pen name are coming from pen table,

i want to restrict user to add "3rd" animal if i have already set the capacity of pen to  2 animals only in pen table , any suggestions?

while adding animal user should get the alert mst or validation like " pen have capacity of 2 animals only select diff pen".

 

    1 reply

    mathieud0001
    Brainy
    March 31, 2022

    You'll have to do an expression rule that queries the database (query entity or record type) and checks the number of animals for a particular pen. You can then use that query in the validations attribute of the Pen name field.