Export (0) Print
Expand All
12 out of 15 rated this helpful - Rate this topic

URL Addressable Forms and Views

banner art

[Applies to: Microsoft Dynamics CRM 4.0]

URL addressable elements enable you to include links to Microsoft Dynamics CRM forms and views in other applications. In this way, you can easily extend other applications, reports, or Web sites so that users can view information and perform actions without switching applications.

URL Addressable Forms

Each form in the Microsoft Dynamics CRM application is a Web page that is identified by a unique URL address. When you type in an address, a window opens with the specified form.

Example

To open a create form for the account entity use the following URLs:

On-premise or hosted versions of Microsoft Dynamics CRM:

http://<server name>/<org name>/SFA/accts/edit.aspx

Microsoft Dynamics CRM Online:

https://<Organization_name>.crm.dynamics.com/SFA/accts/edit.aspx

To open an edit form for an existing account record, specify the object ID:

On-premise or hosted versions of Microsoft Dynamics CRM:

http://<server name>/<org name>/SFA/accts/edit.aspx?id=<object id>
http://crmserver/SFA/accts/edit.aspx?id={1F8B6FC0-426A-4122-BAC2-A05B6071FC57}

Microsoft Dynamics CRM Online:

https://<Organization_name>.crm.dynamics.com/SFA/accts/edit.aspx?id=<object id>
https://adventureworkscycle.crm.dynamics.com/SFA/accts/edit.aspx?id={1F8B6FC0-426A-4122-BAC2-A05B6071FC57}

The following table lists the paths that are associated with some of the main entities.

If you are using the on-premise or hosted version of Microsoft Dynamics CRM use this prefix:

http://<server name>/<org name>/

If you are using Microsoft Dynamics CRM Online use this prefix:

https://<org name>.crm.dynamics.com/
EntityURL
AccountSFA/accts/edit.aspx
ContactSFA/conts/edit.aspx
OpportunitySFA/opps/edit.aspx
Case (Incident)CS/cases/edit.aspx
ProductProducts/product/edit.aspx
E-mailActivities/email/edit.aspx
TaskActivities/task/edit.aspx
CampaignsMA/camps/edit.aspx
CustomUserDefined/edit.aspx?etn=<entity name>

UserDefined/edit.aspx?etn=<entity nname>&id=<object_id>


For custom forms the etn parameter is the Entity Type Name. This is the logical name of the custom entity, like "new_bankaccount". Using this parameter is preferred. It is also possible to use the parameter etc (Entity Type Code), however this value will vary between on-premise implementations. The entity type code for all entities (including custom entities) is available using the Metadata Browser. For more information, see Using the MetadataBrowser.

Passing parameters to set values to new records

When you open a new form using the URL address you can include arguments in the query string to set field values. The following requirements must be met:

  • The names of the query string arguments must match or include the names of attributes for the entity.
  • Lookup and Customer lookup fields should use the suffix 'name' with the attribute name to set the text to display.
  • Customer lookup fields must use the suffix 'type' with the attribute name to set whether the reference is to an account or a contact.
  • The values passed must be valid.
  • The value cannot be a script.

Any attempt to pass an invalid parameter or value will result in an error.

Note   This technique currently works for all entities except Activity entities.

  • For Lookup fields, include an additional parameter to set the name to be displayed in the lookup. The name of this parameter is the attribute name + 'name'. For example, the Parent Account field in the Account form requires a parameter of 'parentaccountidname'.
  • For Customer lookup fields, the type of record must also be set. The name of this parameter is typically the attribute name + 'type'. For Customer lookup fields the value may be either 'account' or 'contact'. For example, the Parent Customer field in the Contact form requires a parameter of 'parentcustomeridtype'.
  • For Boolean fields, use either an integer value of 0 or 1, or a text value of true or false to set the value.
  • For DateTime fields, use the text value of the date.

Example

The name field for a new account can be set to "Test Account" using this URL. This will set the value for this text field to "Test Account".

sfa/accts/edit.aspx?name=Test Account

Example

To set values for lookup and picklist fields, use the unique ID or integer value for the respective field. This will set the parent account field to a corresponding record and the Relationship Type picklist field to "Customer".

sfa/accts/edit.aspx? parentaccountid={<GUID ID VALUE>}&parentaccountidname=Parent Account Name&customertypecode=3

Example

To set the Est. Close Date field for a new opportunity to December 13, 2008, use the following:

sfa/opps/edit.aspx?estimatedclosedate=12/23/2008

Example

To set the Parent customer record for a new Contact record, use the following:

/sfa/conts/edit.aspx?parentcustomerid={<GUID ID VALUE>}&parentcustomeridname=Parent Customer Name&parentcustomeridtype=account

URL Addressable Views

Many views in Microsoft Dynamics CRM allow a user to copy the URL for a particular view or send an e-mail with the URL for a particular view embedded in the message. This feature is primarily intended to facilitate communication between users, but it also exposes a way for a developer to get access to a URL for a view that they can include in another application, such as a SharePoint site.

The page displayed by the URL allows users to search for records, access other views for the entity, and perform actions found the actions toolbar.

URL addressable views cannot bypass Microsoft Dynamics CRM security. Only licensed Microsoft Dynamics CRM users will be able to access the views and the records they see in the views is based on the read privileges for their security roles.

Use these steps to get the URL for a view:

  1. Open the view you want to use.
  2. In the Actions Toolbar select More Actions.
  3. Select Copy Shortcut and then click Of Current View.
  4. The name of the view and the URL is copied to your clipboard in this format:

On-premise:

<View Name>
<http://<server name>/<organization name>/<business module directory or _root directory>/homepage.aspx?etc=<entity type code>&viewid=<GUID representing the Saved Query>>

Online:

<View Name>
<https://<Organization_name>.crm.dynamics.com/<business module directory or _root directory>/homepage.aspx?etc=<entity type code>&viewid=<GUID representing the Saved Query>>

Note   Views that use the user context as a parameter, such as My Accounts, cannot be copied.

Note   The GUID that represents system views for system entities will be the same for each on-premise Microsoft Dynamics CRM installation. The GUID for custom entities and custom views will be unique for each Microsoft Dynamics CRM installation. You can retrieve the type codes for all entities by using the RetrieveAllEntities message.

If you have an on-premise deployment, you can use the Metadata Browser to view the entities and their type codes for your organization. See Using the Metadata BrowserV4d0_SP2810c_MetadataBrowser.

The URL can be used in other applications, for example, as the target of an IFRAME in an on-premise Microsoft Dynamics CRM installation.

<html>
 <head>
  <title>Open Leads</title>
 </head>
 <body>
  <iframe 
src="http://<server name>/<organization name>
/_root/homepage.aspx?etc=4&viewid=%7B00000000-0000-0000-00AA-000010001006%7D" height="400px" style="width:600px" />
 </body>
</html>

See Also

Other Resources


© 2010 Microsoft Corporation. All rights reserved.


Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.