Check out the latest features available in Dynamics 365 for Customer Engagement, including LinkedIn Connect, Voice of the Customer and Universal Resource Scheduling.
Dynamics 365 2019 release wave 2 plan Discover the latest updates to Dynamics 365.Release Plan | Weekly Deployment Notes
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants.Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements.
ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Talent TechTalks
I have work order entity form showing details of a work order in portal which contains a subgrid(Parts grid). in the subgrid i render work order products form which contains products lookup field. I want to filter the products based on the category field value on the form. How can i achieve this filteration which is dynamic?
Let's make it simple.
You have Category field in your Entity Form (Work Order). ANd you want to filter the Products on Subgrid form based on that Category.
In order to achieve this OOB, keep the Category field on Subgrid Form also. And auto-populate the same value that you have opted in Entity Form (Work Order).
Now the question is how do I auto-populate Entity Form Category to Subgrid Category field?
The answer is- using local storage - https://www.w3schools.com/html/html5_webstorage.asp
On change of Entity Form's Category Lookup Field, Get the value of Entity Form Category and store it in Local Storage and
On Load of Subgrid Entity Form, Get the values from Local Storage and Set it in Subgrid Form's Category Lookup Field.
Now, you might aware of CRM OOB lookup filtering, If not have a look below article:
In CRM, Configure the lookup filtering on the Subgrid form. And filter Products based on Category. The Category will automatically auto-populated from Local Storage so the Products will get filtered based on Category.
Can check my similar post here also:
Hope you understood.
If my answer helped to resolve your issue, kindly verify it by clicking 'Yes'. It would be helpful to the other community members seeking to resolve a similar issue. CheersArpithttps://arpitmscrmhunt.blogspot.in
Thanks Arpit, but currently i am having this field in quick view form so i am not able to get the value of lookup. Any idea ?
I kept one lookup field inside Quick View Form and here is the way to get the lookup values:
// Change the ids in below two line as per your lookup field schema name. (highlighted with black in an image 2).var catName = $('#parentcustomerid_name').val();var catId = $('#parentcustomerid').val();
// Store in localstorage
Below is the Quick View Form on my page and having Primary Contact Lookup field.
Here is the Ids (highlighted with black) and its values (highlighted with red):
On Subgrid Form get the value from local storage and Set in Category field in order to filter the Product
//get the value from local storage
var categoryName = localStorage.getItem("categoryName");
var categoryId= localStorage.getItem("categoryId");
// Set value in category lookup
$("#category_name").attr("value",categoryName); $("#categoryid").attr("value",categoryId); $("#category_entityname").attr("value","categoryentityLogicalName");});
Can refer my article to set value in lookup - http://arpitmscrmhunt.blogspot.in/2016/09/adxstudio-set-values-in-lookup-fields.html
Note: Change the HTML Control Ids as per your field's name, I have used the dummy Ids for demonstration purpose.
i could set the look using the method you have provided but i could not fire its on change event so the quick view did not display
Business Applications communities