Looking for PowerObjects? Don’t worry, you’re in the right place! We’ve been part of HCL for several years, and we’ve now taken the final step in our acquisition journey: moving our website to the HCL domain. Nothing else is changing – we are still fanatically focused on Microsoft Business Applications!

PowerObjects Blog 

for Microsoft Business Applications


Populating Field Values in a Form Using a Query String in CRM 2011

Post Author: Joe D365 |

If you want to create a Dynamics CRM 2011 form pop and automatically populate fields in the form, one of the best ways to get the job done is to use query string values. CRM 2011 supports the option to populate fields using query strings.

By populating the fields with a query string in CRM 2011, we avoid some JavaScript rules. You might use a screen pop if you have a custom portal that redirects you to CRM, if you are sending a link to a CRM form, or if you are creating a screen pop such as in a phone integration.

To do this, you'll need to add a string to the extraqs value in the query string:

https:///main.aspx?etc=1&pagetype=entityrecord&extraqs=

You can populate the following field types with this method:

  • Option sets
  • Boolean fields
  • Strings
  • Dates
  • Lookups (Custom Lookup, Customer Lookup , Owner Lookup)

Note: You can't populate PartyList or regarding lookups with this method.

Populating the Option Set

Let's say you want to auto-populate the Address Type in the account form. To do this, add address1_addresstype1. The query string will look something like this:

/main.aspx?etc=1&pagetype=entityrecord&extraqs=address1_addresstypecode1

populate fields with a query string in CRM 2011

Populating Boolean Fields

Populating Boolean fields will be similar to how you populate the options set. Set the field value and an integer value of 0 or 1.

Populating String Field

For the field name, add the following string after the field's name:

/main.aspx?etc=1&pagetype=entityrecord&extraqs=namePower Objects CRM

Populating the Date Field

Populating the Date field will be a little more complicated because the string will need to be coded. For example, if you want to display 07/04/2013, you will need a string of 070413.

Populating Lookup Field

Populating a lookup field for a simple lookup will be the entity's guid and the string. For example, let's say our Primary Contact is Joe CRM. It would look like this:

primarycontactid132525B5-75BD-E211-8F5E-000C298A36A7primarycontactidnameJoeCRM

If you use Customer or Owner, you will need to add the type of the lookup. For example, the owner system user will be:

ownerid132525B5-75BD-E211-8F5E-000C298A36A7owneridnameJoeCRMowneridtypesystemuser

Tips:

1. If you get an error screen, you might have entered something incorrect in the query string or missed something this screen. This is what the error will look like:

2. You can combine several fields together. For example, if you want to populate two lookups and option sets, you will need to add the & sign.

3. Make sure that the guid that you are providing in the look up is the correct one.

Hope this helps! If you want to add more JavaScript to your forms on load, these blogs might come in handy:

Happy CRM'ing!


Joe CRM
By Joe D365
Joe D365 is a Microsoft Dynamics 365 superhero who runs on pure Dynamics adrenaline. As the face of PowerObjects, Joe D365’s mission is to reveal innovative ways to use Dynamics 365 and bring the application to more businesses and organizations around the world.

One comment on “Populating Field Values in a Form Using a Query String in CRM 2011”

PowerObjects Recommends