-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filtering Dropdown Selection List Prior To Searching #24
Comments
Update I figured out how to do this. For anyone else wondering, extract the solution package. Go inside the 'Controls' folder and open the 'bundle' JavaScript file. Search for 'filter=' and you'll find the specific line of code in the function 'MultiSelectPCFControl.prototype.notifySearch' that executes the filtering API call. The default code is: I updated this to: The new code adds my particular filter to only show active status records, and I also added in logic to sort the options by the displayFieldLabel in ascending order. Once you make the changes, zip all the files together again, and import the new solution in. Note I had to delete the previous solution entirely and add in the new one for my changes to take effect. All works! |
Yes this makes sense. I will be taking a look at thisnas someone has asked for a similar requirement. I will take a look. I'm glad you found a quick fix for now. |
I have a similar requirement. I need to pre-filter based on Business Unit which is a lookup on a custom Product table. How can I accomplish this? I've tried putting the 'businessunitid' schema in the filterField in the component config, but this doesn't seem to work. Any suggestions? |
Hey Mark,
Currently, the filter field seems to primarily function as a search tool, which is useful, but I require pre-typing filtration.
Let's say in the related table, we have columns named 'Company Name' and 'Status'. Ideally, before a user starts typing, the dropdown list should already be filtered to display only items where the status is 'Active'.
For instance, let's consider a scenario with three records in the related table:
Company Name | Status
Amazon | Active
Google | Active
Apple | Inactive
If a user attempts to search for 'Apple', they shouldn't retrieve any results, and it shouldn't appear in the dropdown because it's marked as Inactive.
Deleting inactive items from the related table isn't feasible since we need to preserve historical data in archived records. Thus, when an item becomes 'Inactive', users shouldn't be able to select it in future records, but any archived record retaining that value should remain unchanged.
Do you have any suggestions on how to accomplish this?
With much gratitude,
Paden
The text was updated successfully, but these errors were encountered: