Scenario:
2 lookups Country and City
When the user selects UK from first lookup then second lookup lists cities belongs to UK( based on lookup filtering feature)
Now the user would like to update Country to Denmark. so when the user selects country as Denmark then the city lookup should be cleared. And then the user gets a chance to choose cities belongs to Denmark.
This could be achieved by simple javascript by passing an attribute.
Code Snippet:
function SetLookupNull(lookupAttribute)
{var lookupObject = Xrm.Page.getAttribute(lookupAttribute);
if (lookupObject != null)
{
Xrm.Page.getAttribute(lookupAttribute).setValue(
null);
}
}
The function call is on the onchange event of first lookup
Please note that we need to pass the attribute name of the lookup which should be cleared.
The key advantage of the above function is reusability. You could clear any lookup value as per the need by supplying the attribute name as shown.
It is not working .......... :\
ReplyDeletesorry for my first comment......
ReplyDeleteIt's works fine
Thanks for providing your information and keep share with us Azure Online Course Bangalore
ReplyDelete"Customized CRM Software Solution and CRM Applications Development Services India For Your Business" - Hire the expert custom CRM software developers for your crucial projects. Our highly motivated professionals are ready to serve you 24*7.
ReplyDelete
ReplyDeleteNice blog..! I really loved reading through this article. Thanks for sharing such a amazing post with us and keep blogging...
CRM Software in Denmark