Quantcast
Channel: Microsoft Dynamics CRM
Viewing all articles
Browse latest Browse all 137182

Blog Post: MS CRM 2011: Open new activity form with ‘Regarding’ field prefilled

$
0
0
I had a task today to open new task form with Regarding field prefilled. Based on SDK description I tried to use following code to accomplish my task:

varparams = {
regardingobjectid: referenced record id,
regardingobjectidtype: referenced record type name,
regardingobjectidname: referenced record display name
};

Xrm.Utility.openEntityForm("task", null, params);

Unfortunately this code failed. I’ve started to look for some explanation and I found it in SDK at the same article I’ve mentioned before. Answer was that it is impossible to set values for partylists and regarding lookups.
I knew that this feature works for out of box buttons so I rechecked URL for activities that are created with OOB buttons and reworked code to following which worked without issues:

varparams = {
pId: referenced record id,
pType: referenced record type code,
pName: referenced record display name
};

Xrm.Utility.openEntityForm("task", null, params);

Viewing all articles
Browse latest Browse all 137182

Trending Articles