adding CRMParameter to dialog URL

Sep 5, 2013 at 5:32 PM
I'm trying to run a dialog from a button on the contact ribbon. I want to get it to pass the guid of the contact record into the dialog url but i'm unsure how to do this.

I have the url

But i need to add the parameter to the contact ObjectId= on the end. In the ribbon editor i have added a Crm Parameter called guid with the value FirstPrimaryItemId but i don't know how to actually add this to the url

what do i do?

Jan 10, 2014 at 10:29 AM
Edited Jan 10, 2014 at 10:30 AM
Sorry for the late reply.
Generally, in this case I would suggest using JavaScript function and open the window from it passing the ID parameter. I don't think it is possible via Url feature.

As for your need, this is the function I used for running Dialogs from entity form. If you want to use it in grids, you will need to adapt it a bit.
RunDialog = function (dialogId)
    if (!dialogId) throw new Error('Dialog ID is not specified');
    if (! throw new Error('Unable to determine record ID');
    if (! throw new Error('Unable to determine entity name');
    var lookupItems = new Object();
    lookupItems.items = new Array();
    lookupItems.items[0] = new Object();
    lookupItems.items[0].id = dialogId;
    return Mscrm.FormAction.runDialog(lookupItems,,;
Marked as answer by EvgenijM on 3/10/2014 at 8:11 AM
Mar 3 at 6:37 PM
Edited Mar 3 at 6:38 PM
In this same vein, I'm looking to pass a field to the end of the URL like described above, but to a URL outside of CRM.

For Example, let's say the field is "new_car" and I want to append it to the end of the link: ""

So, the button would launch a new tab off the contact record with the full address being "*"

Ideas on how to achieve this?