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

Question

Question

Forms Lookup Rules executed twice?

asked on November 14, 2016

It seems like Lookup Rules might be executed twice: once when displaying the form fields, and again during the form submission process.

I have a Form (v9.2) with a text input field (User AD ID) and a read-only field (Employee Number) that is populated with a Lookup Rule (i.e. the user enters text into the input field and presses tab which triggers the Lookup Rule to populate the read-only field). For example, the user enters "kwoychesko" for the User AD ID and the Lookup Rule populates "1000" into the Employee Number field. When the form is submitted, a workflow runs and uses the lookup data (e.g. 1000) to do various tasks.

This normally works, unless the text input field is auto-corrected by the browser. For example, if the user enters "tli" (for Tom Li) and presses tab, two things happen:

  1. The Lookup Rules display the correct Employee Number "1050" for user "tli", but
  2. The browser subtly auto-corrects "tli" to "tai".

When the form is submitted, the Thank You page does not show the same information as the user saw, instead it shows the results of doing the Lookup using "tai" -- the Employee Number field is blank because no user "tai" exists in the database. So it seems like the Lookup Rules must have executed again.

If it does execute the Lookup Rules twice, I think this is a problem, not just for my use-case. For my use-case, you could argue that the Form submitter should have noticed the subtle change from "tli" to "tai", even though the rest of the looked-up data is correct. For other use-cases though, it's more of a problem:

  • What if the backend database changes quite often, such as a db that contains transactional data? The results displayed on the form to the user might not be the same as during the second lookup.
  • What if the database has a stored procedure that is executed on each lookup? The SP would execute twice as many times as it should.

 

Thanks for any input!

Ken

0 0

Answer

SELECTED ANSWER
replied on November 14, 2016

For read-only field that is configured to populated using lookup rules, the lookup rule does executed again when process the submitted form in the backend. This is to avoid front end manually change the lookup result by various methods such as edit the html or change the request directly and to grantee the data does populated from the database. If you don't want the lookup rule to be executed twice, you can change the field to the editable.

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.