In this webinar, our experts showcase a variety of demo use cases of how different components of the...
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://
You can populate the following field types with this method:
Note: You can't populate PartyList or regarding lookups with this method.
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
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.
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 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 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
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!
Thank you. it's really helpful