Create Appointment with Multiple Recipients in Dynamics
I need to create an appointment with multiple recipients in MS Dynamics. Note that I do not actually want to save the appointment...that should only happen once the user clicks save. I just want to display the form with multiple recipie开发者_如何学Pythonnts already added.
If I use the URL for the appointment form:
/activities/appointment/edit.aspx
I can specify a partyId url parameter which is the Dynamics GUID for the person I want to add to the recipients....but what if I want to add multiple recipients? Is there a way to do this with URL parameters?
If not, is there a way to programatically add recipients in the form's OnLoad javascript? That is, are there any JavaScript API hooks for this?
Thanks.
No, you won't be able to set more than one party using CRM's partyid/partyidname query string parameters.
Yes, there are onload hooks. Lookup scripting reference. In the second example you'll see how they set a lookup in script.
// Add the object to the array.
lookupData[0] = lookupItem;
You'd just have multiple of these for each of your recipients/resources.
// Add the object to the array.
lookupData[0] = lookupItem;
lookupData[1] = lookupItem2;
lookupData[2] = lookupItem3;
Then its just a matter of how you pass the data to the appointment edit form. You can't add random query string parameters (CRM validates all query string parameters are in a set of known parameters). So you have to do something else to send the data. A couple options...
- Put the GUIDs/Names in a cookie in the opening page and parse in the onload (CRM already requires cookies).
- Create a string attribute and put it on the appointment form. Hide it using javascript (display:none). That part is "unsupported", but you're not going to want a visible attribute containing a bunch of GUIDs. You'll be able to google hiding a form field. Use this attribute to pass/validate your data by query string. Parse the attribute at runtime.
Hope it helps...
精彩评论