1
votes

I am working with Dynamics CRM 2011 on premise. I wanted to find out how we can open a particular contact using a URL by using a phone number.

The URL looks like this:

server/organization/main.aspx?etc=2&id=%7b203C4B46-5822-E211-B26E-000C295CF877%7d&pagetype=entityrecord

I wanted to know how this ID is created and whether using the search field like phone number this ID can be found/called.

2

2 Answers

1
votes

I found a similar question posted to the Microsoft Dynamics CRM community forum. There was a useful response from a Microsoft CRM support engineer. I'll quote it below.

https://community.dynamics.com/crm/f/117/t/87837

In order to open a specific record in CRM you must provide the unique identifier for that record type.

So for account records it would be accountId. You would not be able to build a URL for an account edit form that provides some other value for some other attribute and have it open a specific record.

The Microsoft Dynamics CRM SDK provides a section specifically for how to open records by building a URL.

http://msdn.microsoft.com/en-us/library/gg328483.aspx

How you get to a specific record in CRM depends upon in what context you are accessing CRM data.

If you are in the web client, you could use Advanced Find to look for Accounts and add a filter condition to search for records with a specific telephone number.

If you need to open a CRM account directly by only knowing the telephone number for an account, again you would need to leverage the CRM SDK.

You could create an HTML web resource and in the query string for the HTML web resource provide the data to identify the account (in your case some telephone number). On the HTML page you could have some onload javascript that calls into the OrganizationData.svc ODATA service and query for accounts based on the criteria you have provided on the query string, then you could build up the URL for the account (since now you have access to the accountId) and redirect from your HTML web resource to the URL for the account.

0
votes

The ID is assigned by CRM at creation. You will need to search for the ID first using web service methods (specifically a RetrieveMultiple), then you can just build up the url.

This thread has an example of doing this in CRM 4: Retrieving a single Guid in CRM 4.0.

Then you will just need to build a version using the CRM 2011 SDK (though you could use the CRM 4 methods as they are still supported).

Resources:

Build Queries with QueryExpression