We recently had a scenario when we had to set the default value for the look up field when the form gets loaded. Previously it was loaded with Account entity but we had to get it changed to Contact.
After checking different blogs I got the answer in different forums. Here is a link to one among them which I referred.
Xrm.Page.getControl("customerid").setDefaultView("Guid_for_the_view");
First line of code will set the default type to the Contact entity. Second line will set the lookup view.
If we are not using the second line of code, then "My Active Contacts View" or your selected default view will be set.
This is one another post which share similar idea on that. You can refer as per your requirement.
Hope this helps you.
No comments:
Post a Comment