Dynamically Filter User Lookup in CRM Subform
We have a subform called Pricing Calculator in the Zoho CRM Opportunity module and need some assistance.
Current Setup:
First column: Picklist (Level)
Second column: User Lookup field
When a Level is selected, we want the User lookup to display only users with that Level.
In the User form, there is a field called Level.
What we have tried:
1- Used client script with ZDK.Page.setCriteria(), but it did not work for the User lookup field.
- ZDK.Page.getSubform('Pricing_Calculator').getField('User_1').setCriteria("(Level:equals:" + level + ")", { filterOnSearch: true });
2- Tried normal lookup field, but could not retrieve the users in there.
3- Retrieved all users and attempted to filter, but could not set the filtered list as options for a new picklist input.
- var allUsers= ZDK.Apps.CRM.Users.fetch();
- allUsers= allUsers.filter(item => item._Level == level);
Request:
Is it possible to dynamically filter the User lookup based on the selected Level? If yes, could you please share the best approach or a sample implementation?
Moderation update: Screenshot with PII information removed to protect privacy of OP.