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

Question

Question

Forms - Lookup to populate a field used in another lookup's clause causes that lookup to run for every value

asked on July 2, 2020 Show version history

I have a lookup set to displays results based on a drop down selection.

When I create a second lookup to populate the drop down selection, with a large set of values to choose from, for every value this lookup returns, the first lookup runs again.

So the first lookup runs 800 times. Why would this be? Lookups should only run when the form is first loaded and when the user makes a change, not as lists are being populated by other lookups.

Update:

Ah I found the issue. It appears the lookup triggers a change for every value it enters into the field. Since Forms has this issue where it keeps inserting blank values as choices into drop downs I have javascript preventing blank from being chosen.

This is because for some reason forms does not let me remove it even though I looked up the correct syntax. So Instead when blank is chosen I have to force choosing another value.

$('.noblanks select option[value='']').remove();

So the lookup for every value triggers a change and chooses the one choice I don't want available, which is [blank] 800 times. If I could just remove this from my drop downs javascript would not be required. Normally you must tell the system you want to "add blank as a choice" when creating drop downs, but in Forms it does it anyways.

0 0

Replies

replied on July 3, 2020

Can you make the field as required so blank value won't be submitted instead of remove the blank value using JavaScript?

0 0
replied on July 3, 2020

Actually what I wanted to prevent was blank from being chosen, for lookup purposes. For example the Location drop down has a default of Any, making it clear that the lookup is displaying results for any location.

The user might select a specific location, but then when they go back to the list at the top there is a blank value, and I want to prevent them from choosing that and not having any results come back.

0 0
replied on July 6, 2020

Actually Forms will not show the blank option in the drop-down if the field is set as required.  Can you set the field to required and set it with a default value so it will always not show blank?

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

Sign in to reply to this post.