I have a customized form in Dynamics that I want to add some contacts to a list. I'd like to use the built in add to list form for this:
_grid/cmds/dlg_addtolist.aspx
I'd like to be able to do something like this
window.showModalDialog("/" + organizationName + "/_grid/cmds/dlg_addtolist.aspx?
iObjType=2&iTotal=" + iTotal + "&itemObjectId=" + itemObjectId + "&itemObjectTypeCode=" + itemObjectTypeCode,
/* put the ids in here...but in what format? */ );
But when I try this using a simple json array of the ids as the argument for showModalDialog call, Dynamics throws the following error (in the Event Viewer) (after the form pops up and I click ok to continue):
Exception information:
Exception type: ArgumentOutOfRangeException
Exception message: Expected 'Guid' data type for 'iId' parameter in 'Request.QueryString'. The raw request was 'POST /Dynamics/_grid/cmds/dlg_addtolist.aspx?iObjType=2&iTotal=1&iIndex=0&itemObjectId=35b5B78B84B-675C-E011-AACF-00155D1FB10935d&itemObjectTypeCode=4300&iId=889169' called from http://crm.dev.com:8515/Dynamics/_grid/cmds/dlg_addtolist.aspx?iObjType=2&iTotal=2&it开发者_Python百科emObjectId={5B78B84B-675C-E011-AACF-00155D1FB109}&itemObjectTypeCode=4300.
What am I doing wrong?
Thanks.
Using Fiddler, I was able to see that when items are being added to a Marketing List, it's done as a POST, not a GET request.
The URL format was:
/{organizationName}/_grid/cmds/dlg_addtolist.aspx?iObjType={entityTypeCodeOfItemToBeAdded}
&iTotal=1&iIndex=2&itemObjectId={guidOfTheList}&itemObjectTypeCode=4300
&iId={guidOfTheItemToBeAdded}
Each item to be added to the list had a separate POST created.
精彩评论