locked
How to get the current selected record Id from a system or custom view RRS feed

  • Question

  • Hi,

    How do you get the record Id of a selected record from a system or custom view using Xrm.Page JavaScript method?

    I need the Id when a user clicks on a custom Ribbon button from the Active Contact View to begin with.

    Thanks


    • Edited by SPCRM2011 Wednesday, March 12, 2014 1:10 PM
    Wednesday, March 12, 2014 1:03 PM

All replies

  • Hi 

    You can get selected Control by using CRMParameter to the Javascript method. 

     <JavaScriptFunction Library="$webresource:ABC.js" FunctionName="GetMethod">
                 		<CrmParameter Value="SelectedControl" />
                               </JavaScriptFunction>
    fucntion GetMethod(SelectedMethod)
    {
    // Your code.
    }

    You can download CRM Visual Ribbon Editor and do this.. The utility saves your time.

    --

    Regards,

    Gopinath

    mscrmtechie.blogspot.com

    Wednesday, March 12, 2014 1:43 PM
  • My other question how do I add a Custom Ribbon button on the Contact List View? Which entity do I need to export?
    Thursday, March 13, 2014 7:47 PM
  • Do I need to export the Application Ribbon and the Contact Entity and then make changes to RibbonDiff Xml?
    Thursday, March 13, 2014 8:38 PM
  • Hello,

    You need to add your button on home page grid, I will suggest you to use ribbon workbench, it will be easy, you can also do this manually by exporting contact entity. Check this similar post


    Our Website | Our Blog | Follow US | My Facebook Page | Microsoft Dynamics CRM 2011 Application Design
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Friday, March 14, 2014 12:07 AM
    Moderator