Tuesday, 6 September 2016

Modify the Delete (Dustbin icon) Button in the CRM Subgrid


Sometimes we need to modify the Delete button in the CRM Subgrid, example:

1. For preventing users to perform the delete button (but you dont want to just disable it)

2. Call another function or call custom function that needs client site programming (We can do plugin onDelete or onAssociate, but in case you want to show it in the client site)

3. To do impersonation

The Code

function modifyRibbon() {
    modifySubgridDeleteButtonEventHandler("subgrid_name_in_the_form", deleteSubgridRecord, true);

function deleteSubgridRecord() {

function modifySubgridDeleteButtonEventHandler(subgridName, functionToCall, passGridControl) {
    try {
        //to store the original function ones
        var originalFunctionDeleteRecordSubgrid = Mscrm.GridCommandActions.deleteRecords;
        //add new standard subgrid
        Mscrm.GridCommandActions.deleteRecords = function (selectedControl, selectedControlSelectedItemReferences, selectedEntityTypeCode) {
            //if (typeof (gridControl.get_id).toString().toLowerCase() == "undefined") {} //no need since I replaced by the previous line
            if (selectedControl.get_id() != subgridName) {
                originalFunctionDeleteRecordSubgrid(selectedControl, selectedControlSelectedItemReferences, selectedEntityTypeCode);
            else {
                if (passGridControl) {
                else {
    catch (e) {



*After clicking the ‘Delete’ button


Note: This method is overwriting the CRM functions and it works for CRM 2013, for CRM 2015/2016, this function [Mscrm.GridCommandActions.deleteRecords] might have been changed, so need to find out the current function name based on your CRM Version. And again, it means it is unsupported Smile



  1. It is very helpful to each one. your point of view is the best among many. thanks for posting.I found your blog the most informative one .thanks for providing it as it helped me a lot in grooming my knowledge.On the off chance that you need a noteworthy impact in your neighborhood, publicizing can raise your association's profile and pass on results. Ad spot advertisements put your message specifically before your potential customers. OOH Advertisement ERP is not just about tremendous sheets for the road. There are distribution goals and sizes to suit every single monetary arrangement.

  2. Your blog post is very informative and helpful one. I learned useful information about how to modify the Delete button in the CRM Subgrid.I am Ms Dynamic CRM consultant and its really very helpful information for me.

  3. Nice article really informative for me as on this I’ve found some best results for
    SuiteCRM Customization
    As this found the best services for crm integration
    SugarCRM integration Services
    CRM Integration

  4. Actually this information was quite interesting on content marketing. As we heard about the quality content fresh content bla bla like that. Yes i agree with that one but apart from that we have to make the news in which they are looking for. Okay i am satisfied with your posts. Thank you

    SEO Company in India

  5. Hi,

    Many thnaks for your article. It works fine on 1:N relationship, but on N:N it doesn't work, do you know why ?


  6. This comment has been removed by the author.


  7. شركة غسيل خزانات بالمدينة المنورة و عمال مروبون وحاصلون على شهادة صحية فقط اتصل بنا لتحصل على افضل خدمة غسيل خزانات

  8. Really nice and definitely it will be useful for many people. Kindly keep update like this.

    Manufacturing ERP
    Human Resources Management Software
    CCTV Camera Dealers in Chennai

  9. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. Great work.
    Digital Marketing Company in Delhi
    SEO Services in Delhi
    SEO Company in Delhi


  10. بسم الله الرحمن الرحيم عميلنا العزيز نحن نقدم افضل خدمات تنظيف المجالس والشقق بافضل انواع التنظيفات المشهود لها عالميا
    شركة تنظيف مجالس بالطائف
    شركة تنظيف مجالس بجازان
    شركة تنظيف مجالس بحائل
    ونحن فى خماتكم 24 ساعة على مدار الشهر

    CMR Solutions

  12. Nice Article.
    We are Software Solution Providers in Islamabad, working with international clients in creating, designing and managing their websites and customer relations/Sales etc.
    We Provide:
    1.) SEO and Digital Marketing Services
    2.) Web Design and Development Services
    3.) CRM and ERP systems

  13. Great blog learned many things about Crm Software from this article, very informative .CRM system is the software that you and your company need to automate the processes and activities associated with customer relationship management. For many years, the locally hosted CRM solutions have widely been used by large corporations and medium-sized businesses. Today, you have a chance to implement the CRM systems, too. Likewise, you have a possibility to choose between the locally hosted and web based CRM solutions. The only way to make the right choice is to learn more about the different types of CRM systems.
    Best Crm Software for Small Business
    crm systems for small businesses
    best business management software
    Client Management Software for Small Business
    Customer Relation Management Software
    Customer Management Software Small Business
    Dropshipping Software


  14. The blog was absolutely fantastic! Lot of great information which can be helpful in some or the other way. Keep updating the blog. We are top CRM Software.

  15. I have read your blog post on. I am very much pleased with the contents you have mentioned. We are one of the Best SEO Company in Delhi | SEO Company in Noida | SEO Company in Lucknow.

  16. Thanks for great information you write it very clean. I am very lucky to get this tips from you.

  17. This is really a very good blog and thanks for sharing it with the community!Keep Posting Many Blogs Like this.
    crm software development company in chennai

  18. Thank you for this excellently put together blog. It is very clear and helpful. If you are in a business and want to get a highly professional and effective customer relationship management solution to make a strong client base there are a number of expert services whom you can look up to get the best solutions. Choose them wisely and get the best benefits of this best business management software system with their help.

    crm systems for small businesses|Client Management Software For Small Business|Customer Relation Management Software

  19. Packers And Movers Bangalore Local Household Shifting Service, Get Free Best Price Quotes Local Packers and Movers in Bangalore List, Compare Charges, Save Money And Time at
    Local Packers And Movers Bangalore

  20. Nice information on here, I would like to share with you all my experience trying to get a loan to expand my Clothing Business here in Malaysia. It was really hard on my business going down due to my little short time illness then when I got heal I needed a fund to set it up again for me to begin so I came across Mr Benjamin a loan consultant officer at Le_Meridian Funding Service He asked me of my business project and I told him i already owned One and i just needed loan of 200,000.00 USD he gave me form to fill and I did also he asked me of my Valid ID in few days They did the transfer and my loan was granted. I really want to appreciate there effort also try to get this to anyone looking for business loan or other financial issues to Contact Le_Meridian Funding Service On Email: lfdsloans@lemeridianfds.com / lfdsloans@outlook.com He also available on WhatsApp Contact:+1-9893943740.

  21. Nice image visibility and well written blog. Thanks for sharing. I have recently come across a new online service provider company which provides Shifting Services .
    Packers And Movers Bangalore

  22. Very informative blog about CRM. Thanks for enhancing our knowledge about CRM. Are you looking to improve customer satisfaction levels through our Microsoft Dynamics CRM? Talk to our CRM experts to know what features you can use to make your CRM process more efficient and ultimately boost your productivity.

  23. This is really interesting, you’re a very skilled blogger.
    I have bookmarked this article page as I received good information from this.

    Best CRM Software in Hyderabad | Best ERP Software in Hyderabad

    ERP Software Providers in Hyderabad | Best Cloud ERP Software in Hyderabad

  24. Nice post!..good information,it is really helpful..it really impressed me alot and i just loved it.Thanks for posting such an informative content: @
    Packers And Movers Mumbai

  25. Very nice article. I enjoyed reading your post. very nice share. I want to twit this to my followers. Thanks ! @ Packers and Movers Ahmedabad

  26. Look at the way my colleague Wesley Virgin's report launches with this SHOCKING and controversial video.

    You see, Wesley was in the military-and soon after leaving-he revealed hidden, "MIND CONTROL" secrets that the government and others used to get everything they want.

    These are the EXACT same SECRETS lots of celebrities (especially those who "became famous out of nothing") and elite business people used to become wealthy and successful.

    You probably know how you use only 10% of your brain.

    That's mostly because the majority of your brain's power is UNCONSCIOUS.

    Maybe that thought has even occurred INSIDE OF YOUR very own head... as it did in my good friend Wesley Virgin's head about seven years back, while riding a non-registered, trash bucket of a car without a license and on his debit card.

    "I'm absolutely frustrated with going through life paycheck to paycheck! When will I finally succeed?"

    You took part in those thoughts, isn't it right?

    Your success story is going to happen. Go and take a leap of faith in YOURSELF.

    Learn How To Become A MILLIONAIRE Fast

  27. Thanks for sharing information
    "Pressure Vessel Design Course is one of the courses offered by Sanjary Academy in Hyderabad. We have offer professional
    Engineering Course like Piping Design Course,QA / QC Course,document Controller course,pressure Vessel Design Course,
    Welding Inspector Course, Quality Management Course, #Safety officer course."
    Piping Design Course
    Piping Design Course in India­
    Piping Design Course in Hyderabad
    Welding Inspector Course
    Quality Management Course
    Quality Management Course in india
    Safety officer course

  28. Get Packers and Movers Kolkata List of Top Reliable, 100% Affordable, Verified and Secured Service Provider. Get Free ###Packers and Movers Kolkata Price Quotation instantly and Save Cost and Time. ???Packers and Movers Kolkata Reviews and Compare Charges for household Shifting, Home/Office Relocation, ***Car Transportation, Pet Relocation, Bike SHifting @ Packers and Movers Kolkata

  29. Explore your creative side with this course - Learn the fundamentals of writing short stories, personal essays and poems. Please visit our website to know more information.

  30. Really cool post, highly informative and professionally written and I am glad to be a visitor of this perfect blog, thank you for this rare info!
    CRM Software

  31. Thanks, this is generally helpful.
    Still, I followed step-by-step your method in this salesforce cpq training
    salesforce cpq course

  32. Thanks for sharing this informative content , Great work
    Read this blog to know about : Definition of done

  33. Thank a lot. You have done excellent job. I enjoyed your blog . Nice efforts
    Data Science Certification in Hyderabad

  34. Wow, happy to see this awesome post. I hope this think help any newbie for their awesome work and by the way thanks for share this awesomeness, i thought this was a pretty interesting read when it comes to this topic. Thank you..
    Artificial Intelligence Course

  35. I need to thank you for this very good read and i have bookmarked to check out new things from your post. Thank you very much for sharing such a useful article and will definitely saved and revisit your site.
    Data Science Course

  36. Your site is truly cool and this is an extraordinary moving article and If it's not too much trouble share more like that. Thank You..
    Digital Marketing Course in Hyderabad


My Name is..