0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Query Builder】Filter : Preparing a lookup list by using a sub query (Cont.)

Last updated at Posted at 2024-09-24

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.
image.png

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.
image.png

The use of the value chosen in the parent query

image.png
I assume the sub query for the Account Code filter in the parent query has already been defined like this.
image.png

Click Edit Sub Query button to open the sub query definition.
A fixed value D is set for Account Type filter.
image.png

I replace D with the name of the Account Type filter in the parent query, i.e. @parentAccountType.
image.png
The account type chosen is passed here.
image.png

Click OK to save the query
Click OK to save the filter option dialog.

Now, I am with the parent query.
image.png
Click the Lookup button for the Account Type, and select 'P'.
image.png
image.png

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.
image.png

Conclusion

This is useful when we would like to reduce the number of items shown in a lookup list.

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?