You are viewing limited content. For full access, please sign in.

Question

Question

Disable Action button if field values in a row do not match

asked on November 16, 2023 Show version history

I have a table that displays an entry and its document owner. I am looking for a way to disable an action button if there are multiple document owner names. It must only have one document owner name for the batch of entries. 

In the image above, if that was the case, I would want the action button to be disabled. 

 

We are using Forms 11 Modern Designer.

Any ideas will be appreciated.

Jonathan

0 0

Answer

SELECTED ANSWER
replied on November 17, 2023

Here's a thought using some extra (hidden) fields.

1. Add an extra field to your table (hidden) for ROWID (number), formula =ROW()

Fields outside Table.

2. MaxRows (Number), Calculation =MAX(tablename.ROWID) //gets number of rows in table

3. FirstDocOwner, (singleline), Calculation =(tablename.docOwnerfield,1) //capture the docOwner from the first row.

4. CountOwners (number) = COUNTIF(tablename.docOwnerField,FirstDocOwner)//counts number of owners that match the first owner

5. MatchOwners (singleline)  =IF(CountOwners=MaxRows,"True","False")//if numbers match then owners are same on everyline.

6. Set field Rule to Show Action button when MatchOwners is True, or vice versa

Other than this would require JS to read the Table into an array (steps 1-4) and do the comparitive there and return the reply to the MatchOwners field in step 5

1 0
replied on November 20, 2023

Thanks Steve. 
Your idea has worked. 
However, I did simplify it a little. Instead of doing step 5, I did this for the final step...

Also, for step 3, the calculation was missing INDEX. Calculation =INDEX(tablename.docOwnerfield,1)

1 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.