Home
> CRM, CRM 2011, CRM 4.0, JScript > Set field values using query string parameters on Form load in CRM
Set field values using query string parameters on Form load in CRM
Hi,
I have got below requirement,
- I need to open a CRM form from my custom ‘.aspx’ page.
- On opening of the form I should populate “name” field with value
After referring MSDN article, I came to know that we can set the field values using “extraqs” query string parameter and it must meet below requirements.
- You must encode the parameters passed in the extraqs parameter. Use encodeURIComponent to encode the parameters.
- The names of the query string arguments must match or include the names of attributes for the entity.
- The value cannot be a script (To prevent script injection)
Below is the sample JScript to open a form and populate “name” field on form load
function openform() {
var encodedString = encodeURIComponent(“new_name=rajeev pentyala”);
window.open(“http://ServerName/OrgName/main.aspx?etc=10014&extraqs=” + encodedString + “&pagetype=entityrecord”);
}
- Here “new_name” is the name of attribute
You get the CRM form as below, when you call the above function
Please refer below useful MSDN articles
- http://msdn.microsoft.com/en-us/library/gg334375.aspx
- http://msdn.microsoft.com/en-us/library/gg334436.aspx
- Dynamics CRM Blog
Hope it helps 🙂
Categories: CRM, CRM 2011, CRM 4.0, JScript
CRM, CRM form, encodeURIComponent, extraqs, form load, JScript, open crm form, query string parameters, Set field values
Comments (0)
Trackbacks (0)
Leave a comment
Trackback