Introduction
This post needs to be read after reading this post.
Please read it first then come to this post again.
I’m designing a subquery for the Account Code filter's lookup list, which will be dynamically generated based on a value passed to the subquery.
The value passed to the Sub Query
I use the value of Account Type.
The lookup list for the Account Code filter will be generated dynamically with what Account type is chosen.
Drug and drop Account Type field from Selection
to Filter
.
The name
of Account Type filter is used for passing its value to the sub query.
Therefore, I rename it with more recognisable name.
Rename it with parentAccountType
.
The use of the value chosen in the parent query
I assume the sub query for the Account Code filter in the parent query has already been defined like this.
Click Edit Sub Query
button to open the sub query definition.
A fixed value D
is set for Account Type filter.
I replace D
with the name of the Account Type filter in the parent query, i.e. @parentAccountType
.
The account type chosen is passed here.
Click OK
to save the query
Click OK
to save the filter option dialog.
Now, I am with the parent query.
Click the Lookup button for the Account Type, and select 'P'.
Then open the lookup list for the Account Code.
I can see account code for Account type is 'P' only are displayed in the list.
Conclusion
This is useful when we would like to reduce the number of items shown in a lookup list.