Michael Philip's Blog

Writing about MS Tech with strong focus on Azure & CRM

Opening A Form With Predefined Fields Values In Microsoft Dynamics CRM 2011

Leave a comment

Brief:

If you are inside a form of contact record and you click e mail to create a new email activity , you will notice that the email form when opened has predefined values which are the” Recipient” and the “Regarding” fields set to the contact in which you have clicked to create a new email activity.

-Case:

Suppose you would like to apply the following behavior but for different entity, suppose you would like to open the contact form with the mobile phone  set by default to “001”.

Suppose you would like to apply this behavior when you want to add a new contact when you are inside an account record like the screenshot show.

addcontact

Steps:

  1. Override the command of the button.
  2. Let  the  new command be the following line of code :

window.open(“http://CrmServerUrl/OrgName/main.aspx?etc=2&pagetype=entityrecord&extraqs=”
+encodeURIComponent(“mobilephone=001”) );

  • etc : is the object type code of the “Contact” Entity.
  • pagetype : indicate the mode of the form ( a new record in this case)
  • exstras: the query string parameter which tell the CRM about the predefined values which you should write after the ” extras”parameter in the following format  :      FieldSchemaName=Value

                                                                                        Screenshot Example

mobileform

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s