Tuesday, 6 September 2016

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

Overview

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);
    discountStructureControl();
}

function deleteSubgridRecord() {
    alert("test");
}

function modifySubgridDeleteButtonEventHandler(subgridName, functionToCall, passGridControl) {
    try {
        //to store the original function ones
        var originalFunctionDeleteRecordSubgrid = Mscrm.GridCommandActions.deleteRecords;
        debugger;
        //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) {
                    functionToCall(selectedControl);
                }
                else {
                    functionToCall();
                }
            }
        }
    }
    catch (e) {

    }
}

Result

*After clicking the ‘Delete’ button

image

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

Thanks!

30 comments:

  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.

    ReplyDelete
  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.

    ReplyDelete
  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

    ReplyDelete
  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

    ReplyDelete
  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 ?

    Thanks,
    Sebastien

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete

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


    ReplyDelete
  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

    ReplyDelete
  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

    ReplyDelete

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

    ReplyDelete
  11. THANK YOU FOR THE INFORMATION .HI GUYS IF SEARCHING FOR CRM Solutions PLEASE VISIT US
    CMR Solutions

    ReplyDelete
  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

    ReplyDelete
  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

    ReplyDelete

  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.

    ReplyDelete
  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.

    ReplyDelete
  16. Thanks for great information you write it very clean. I am very lucky to get this tips from you.
    https://blog.mindvalley.com/midbrain-function

    ReplyDelete
  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

    ReplyDelete
  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

    ReplyDelete
  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

    ReplyDelete
  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.

    ReplyDelete
  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

    ReplyDelete
  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.

    ReplyDelete
  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

    ReplyDelete

My Name is..