Tuesday, 6 September 2016

Utilize Custom Action to Help Filtering The Lookup View in CRM Form


Sometimes in our project, we have requirement to filter lookup based on some conditions and it can be achieved using addCustomView or addCustomFilter function.

And sometimes it is just not too easy to do it in Javascript or the complex fetch xml, so in my blog I just want to share another method to get the filtered result same as you wanted, that is using Javascript + Custom Action!


Following my previous post: http://missdynamicscrm.blogspot.sg/2014/08/crm-2013-using-addcustomfilter-to-get-filtered-lookup-field-based-on-linked-entity.html

So, considering you have this filter:

To get the result as per expected, you can use Custom Action.


1. You need to create a custom action that give you output, either STRING or ENTITYCOLLECTION

2. Inside the custom action code, if you want to return string, you can use comma delimited concept, or using | as delimiter, or you can just return the Final XML Filter already.

If you use EntityCollection, you might need to parse it again.

3. Then create a javascript that can call the Custom Action, you can use this method for easy way:

4. Then you get the result as parameter, you can just set it to the filter = “the Result” (if you use Final XML Filter as the Output) or you parse the GUID if you use the comma or | delimited concept, or if you use EntityCollection then you need to parse it back.

5. See the result

Basically, you just need to get this result:


Either you just easily using String as output or other method it is up to u.

But the point here is we can use Custom Action for solving complex filtering and remember that we can use impersonation also to get the data you want if it is related to the other entities as well, imagine if we also need to have multiple entities involved then it might be easier if we use Custom Action as we just replace the DLL if there is any other changes using Plugin Registration Tool.

Hope this helps!



  1. Very Nice Post Aileen,I have read the method to get the filtered result with a different method by using Javascript + Custom Action. It is really very helpful contact for .MS Dynamic CRM consultant services.

  2. I am filtering the Source Campaign lookup based on Optionset Originating Lead
    Field:-Originating Lead
    Condition 1:If originating Lead value "Employee- Frank Hooper" then show all campaigns in lookup.
    Condition 2:For all other Originating Lead value it showed specific Campaigns in lookup.
    Problem:- if originating lead is "Employee- Frank Hooper" it search all campaigns that is good and if change originating lead other
    than"Employee- Frank Hooper" it also search well but when i go again to option set value"Employee- Frank Hooper" now it doesn't show any value.
    so what is reason second time it show unexpected behaviour

  3. good article. I like to read this post because I met so many new facts about it actually. Thanks a lot. Lead Capture Software

  4. Hello! Thank you so much for posting this small tutorial. I think it will be useful for many people who are interested in learning ms dynamics features and such tips like how to utilize Custom Action to Help Filtering The Lookup View in CRM Form.

  5. Your post is very useful for all SAP learners. Thanks for providing such a great post...
    SAP FICO Online Training | SAP FSCM Online Training in India

  6. This post is much helpful for us. This is really very massive value to all the readers and it will be the only reason for the post to get popular with great authority.
    IOS Training in Chennai

  7. Thank you for sharing such a nice and interesting blog with us. I have seen that all will say the same thing repeatedly. But in your blog, I had a chance to get some useful and unique information. I would like to suggest your blog in my dude circle.
    SEO Company in Chennai

  8. It's interesting that many of the bloggers to helped clarify a few things for me as well as giving.Most of ideas can be nice content.The people to give them a good shake to get your point and across the command .
    Cat Coaching in Chennai

  9. Thank you for taking the time to provide us with your valuable information. We strive to provide our candidates with excellent care and we take your comments to heart.As always, we appreciate your confidence and trust in us
    Digital Marketing Company in India

  10. wonderful information, I had come to know about your blog from my friend nandu , hyderaba.
    i have read atleast 7 posts of yours by now, and let me tell you, your website gives the
    best and the most interesting information. This is just the kind of information that i had
    been looking for, i'm already your rss reader now and i would regularly watch out for the new posts

    Oracle Fusion HCM Training

  11. Its a wonderful post and very helpful, thanks for all this information. You are including better information regarding this topic in an effective way.Thank you so much

    Personal Installment Loans
    Payday Cash Advance loan
    Title Car loan
    Cash Advance Loan

  12. i really like this blog.And i got more information's from this blog.thanks for sharing!!!!Digital Marketing Company in Chennai

  13. This blog is having the good information. Got a creative work and this is very different one. We have to develop our creativity mind. This blog helps for this. Thank you for this blog. This is very interesting and useful.

    Self Employment Tax
    Tax Preparation Services
    Tax Accountant
    Tax Consultant
    Tax Advisor

  14. Microsoft Dynamics CRM Implementation | USA | UK | CANADA| INDIA
    Microsoft Dynamics CRM is a platform created to provide organizations with tools to sell smarter, sell efficiently and productively, and heed everywhere. The solution allows a difference of features including social acumen, business knowledge, and fertility with One Microsoft solutions. Customers can prefer how Microsoft Dynamics CRM is used in a way that fits their business: in the cloud, on-premises, or with a cross combination.

    The customer can still obtain the method even when offline.
    Strong integration with Microsoft products.
    Many dashboards.
    Integrated marketing and self-regulation tools.
    Broad integration with third-party apps and methods.

  15. wonderful post and very helpful, thanks for all this information. You are including better information regarding this topic in an effective way.Thank you so much
    Online Tax Services
    Tax Professional
    Online Tax Preparation
    Tax Advisor

  16. It's a wonderful post and very helpful, thanks for all this information. You are including better information regarding this topic in an effective way.Thank you so much.

    Allergy Medicines
    Ayurvedic Medicine For Immunity
    Hyperpigmentation cream
    Viral Fever Medicines

  17. It’s really amazing that we can record what our visitors do on our site. Thanks for sharing this awesome guide. I’m happy that I came across with your site this article is on point,thanks again and have a great day. Keep update more information..

    Selenium Training in Chennai

  18. It is really a great and useful piece of info. I’m glad that you shared this helpful info with us. Please keep us informed like this. Thank you for sharing.
    Web design company in chennai

  19. Very amazing blog on a fresh new topic. I am definitely going to use the information provided in this blog because of its novel and fresh. Thanks for sharing such valuable information with everyone.
    Web development company in bangalore
    Outsource magento ecommerce services india
    ECommerce Website developers in bangalore

  20. What you have written in this post is exactly what I have experience when I first started my blog.I’m happy that I came across with your site this article is on point,thanks again and have a great day.Keep update more information.
    Software Testing Training in Chennai
    SEO Training in Chennai
    Informatica Training in Chennai
    Digital Marketing Training in Chennai

  21. Its really an Excellent post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog. Thanks for sharing....

    Carwash in omr
    usedcars in omr
    automotors in omr
    car accessories in omr
    secondhand car in omr

  22. Thanks for sharing informative blog with us.

    CRM Implementation

  23. Sudah seru, odds nya menguntungkan lagi!!. itulah permainan sabung ayam online di sabung ayam
    Dapatkan informasi penting dalam dunia sabung ayam di website bawah ini


My Name is..