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

Question

Question

Load rule based on value, then load the rest

asked on March 9, 2017

Good morning,

I have an LF textbox with a default value of "Y". Then I have a lookup rule that pre-populates a drop-down menu, based on that value.

Say that there is a table in the database that looks something like:

 

ID | VALUE
____________

 X  | x-value

 Y  | y-value

 Z  | z-value

 Z  | z-value

In my lookup rule I have (WHEN textbox value is "Y" Fill dropdown with data source VALUE). The resulting drop-down is a drop-down with "y-value".

Is there a way to append the values of X and Z to the already pre-populated value? In other words, since the value of Y is in the middle, this means that I can't call it acceding or descending, because I want y-value to be populated as the default value, and then the rest. 

The drop-down menu would look like 

[option]

x-value

y-value

z-value 

[/option]

with y-value selected

 

Thanks you,

 

Raul Gonzalez

0 0

Replies

replied on March 9, 2017

If you are using Forms 10.2, you can use following method to archive it:

1. add two lookup rules:

rule 1: match ID with column x then fill VALUE with column y

rule 2: fill VALUE with column y

2. preview the form and open the Developer Tools tab(for example Chrome) from the browser your are using and enable network trace, fill field ID and see there is an request like "lookup?formId=xx" and check the request detail and find the value of ruleId

3.  add custom JavaScript as following :

$(document).on("lookupcomplete", function (event) {
  if(event.ruleId=="20"){
   LF.lookup.autoPopulate();
  }
});

Using the above code will run the rule 2 after rule 1 is completed so it can populate the dropdown with all the possible values and select the value that match the ID.

2 0
replied on March 23, 2017

Was this the answer?

0 0
replied on March 24, 2017

We aren't ready with 10.2 yet. That might be the answer, but as of now we are hoping to find a solution for 10.1

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

Sign in to reply to this post.