Forum Discussion
np,
You actually have a two-part Question.
The first is to have a field that calculates the allowable number of child records. call it say, [# of Allowed Children]
Case([Dealer Level],
"Gold",3,
"Silver",2,
"Bronze",1,0)
Then you make a summary field on the relationship that counts the number of children.
The for the add button that you want to suppress, you do something like this
vat text ADDButton =
URLRoot() & "db/" & [_DBID_CHILD_TABLE_NAME] & "?a=API_GenAddRecordForm&_fid_11=" & URLEncode ([Record ID#])
& "&z=" & Rurl();
iIF([# of Children] < [# of Allowed Children], $ADDButton)
Then if you want to have a message display, you can make a rich text formula field like
IF([# of Children] >= [# of Allowed Children], "<font color=blue><b>Max Children created") and add it to the form. Maybe have a form rule to hide it if it's blank.