web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

pass parameter in ribbon button in dynamics crm by workbench

(0) ShareShare
ReportReport
Posted on by 1,562

Hello All,

I want to pass parameter in ribbon button in dynamics crm by workbench tool.

please guide me soon.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at
    RE: pass parameter in ribbon button in dynamics crm by workbench

    Please check out my answer posted for this question, its verified one

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: pass parameter in ribbon button in dynamics crm by workbench

    Please check out the solution I posted, its verified one

  • Verified answer
    Community Member Profile Picture
    on at
    RE: pass parameter in ribbon button in dynamics crm by workbench

    Download the Ribbon XML from CRM using solution.

    In the command definition of the button, pass the custom CRM parameter value to javascript function as

    "SelectedControl". This will give you the below details of  selected record in the Grid,

    1. Id (Guid)

    2. TypeCode

    3. TypeName (Schema Name of entity)

    4. Name (what you were looking for)

    Here is the example of the XML snippent for a button,

    *******************************************************************************

    <CommandDefinition Id="abcd_grid.Commands.PublishRecords">

    <EnableRules>

    <EnableRule Id="abcd_grid.TestEnableRules.True" />

    </EnableRules>

    <DisplayRules />

    <Actions>

    <JavaScriptFunction FunctionName="ProcessSelectedRecord" Library="$webresource:abcd_/scripts/abcd.forms.js">

    <CrmParameter Value="SelectedControl" />

    </JavaScriptFunction>

    </Actions>

    </CommandDefinition>

    *******************************************************************************

    Here is the javascript function which accepts the parameter and gets the required details of a account record.

    function ProcessSelectedRecord(parameterFromXML)

    {

    var records = parameterFromXML.get_selectedRecords();

    if(records.length>0) // you can run for each loop

    {

    var accountid = records[0].Id // Guid of selected record in the grid - {8BAD1963-0134-E711-811B-0050568268BF}

    var typeCode = records[0].TypeCode // Entity Type Code - 1

    var entityName = records[0].TypeName //  Entity Schema Name - account

    var accountName = records[0].Name // Account Name - Sample Account

    }

    }

    *******************************************************************************

    Hope this helps.

    Jai CRM

    Cheers Buddy!

    Thank you!

    Suraj

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: pass parameter in ribbon button in dynamics crm by workbench

    Hi Tin,

    I know this is late reply, but it would be helpful for someone searching similar solution.

    Download the Ribbon XML from CRM using solution.

    In the command definition of the button, pass the custom CRM parameter value to javascript function as

    "SelectedControl". This will give you the below details of  selected record in the Grid,

    1. Id (Guid)

    2. TypeCode

    3. TypeName (Schema Name of entity)

    4. Name (what you were looking for)

    Here is the example of the XML snippent for a button,

    *******************************************************************************

    <CommandDefinition Id="abcd_grid.Commands.PublishRecords">
    <EnableRules>
    <EnableRule Id="abcd_grid.TestEnableRules.True" />
    </EnableRules>
    <DisplayRules />
    <Actions>
    <JavaScriptFunction FunctionName="ProcessSelectedRecord" Library="$webresource:abcd_/scripts/abcd.forms.js">
    <CrmParameter Value="SelectedControl" />
    </JavaScriptFunction>
    </Actions>
    </CommandDefinition>

    *******************************************************************************

    Here is the javascript function which accepts the parameter and gets the required details of a account record.

    function ProcessSelectedRecord(parameterFromXML)

    {

    var records = parameterFromXML.get_selectedRecords();

    if(records.length>0) // you can run for each loop

    var accountid = records[0].Id // Guid of selected record in the grid - {8BAD1963-0134-E711-811B-0050568268BF}


    var typeCode = records[0].TypeCode // Entity Type Code - 1 
    var entityName = records[0].TypeName //  Entity Schema Name - account
    var accountName = records[0].Name // Account Name - Sample Account

     }

    }

    *******************************************************************************

    Hope this helps.

    Jai CRM 

    Cheers Buddy!

    Thank you!

    Suraj

  • Suggested answer
    Abdul Wahab Profile Picture
    12,119 Moderator on at
    RE: pass parameter in ribbon button in dynamics crm by workbench

    Hi Tin Latt,

     

    If your are still not getting solution. Please do let me know.

    Thanks

    Regards,

    AW

  • Community Member Profile Picture
    on at
    RE: pass parameter in ribbon button in dynamics crm by workbench

    OR use Mscrm.EntityReference

    8715.temp.png

    and user

    1. TypeCode: int
    2. TypeName:s tring
  • Suggested answer
    Community Member Profile Picture
    on at
    RE: pass parameter in ribbon button in dynamics crm by workbench

    Hi Vivek,

    Can you please try following steps on RibbonWorkbench..

    1-

    8015.Ekran-Al_3101_nt_3101_s_3101_2.PNG

    2-hit Add and then select CRM Parameters and hit Ok

    8015.Ekran-Al_3101_nt_3101_s_3101_2.PNG

    3-

    Ekran-Al_3101_nt_3101_s3.PNG

    Hope it helps!

    Regards,
    Ezgi

    Please verify if it solves your problem.

  • Community Member Profile Picture
    on at
    RE: pass parameter in ribbon button in dynamics crm by workbench

    How do I pass current entity's logical name as parameter to ribbon workbench?

    Regards.

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: pass parameter in ribbon button in dynamics crm by workbench

    CRM Parameter on Ribbon Button will be SelectedControlSelectedItemIds Refer this:

    lakshmanindian.wordpress.com/.../update-selected-records-in-home-page-entity-grid-in-crm-2011

    ribbonworkbench.uservoice.com/.../129783-pass-the-currently-selected-grid-row-s-to-a-custo

  • Abdul Wahab Profile Picture
    12,119 Moderator on at
    RE: pass parameter in ribbon button in dynamics crm by workbench

    Hi Ezgi HAGLUND

    May you please explain more.? I also have the same problem. I have a JS that needs entity Id to trigger workflow on a button. I have a button as shown below on the home page:

    6558.TemplateButtonLabels.jpg

    Thank You

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Aric Levin - MVP Profile Picture

Aric Levin - MVP 2 Moderator

#2
MA-04060624-0 Profile Picture

MA-04060624-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans