Index (zero based) must be greater than or equal to zero and less than the size of the argument list

Hello friends, I found a weird issue during a USD configuration, I was getting error message “Index (zero based) must be greater than or equal to zero and less than the size of the argument list“, when I was trying to assign a custom entity record to a different agent (systemuser) using USD action call.

Scenario: A CRM custom entity record get created in Unified Service Desk when an agent receives a customer call. And if agent transfer customer call to their supervisor, same entity record should also get assigned to supervisor. Below are the details of the action call I created.

Issue: action call was failing with error message “Index (zero based) must be greater than or equal to zero and less than the size of the argument list“, complete error message was

======================================================================

Action Call# 20

Source:Window Route(CTI Window Navigation Rule – Transfer Call)

Name:Assign Record to Supervisor

Application:Global Manager

Action:UpdateEntity

Action Data:Id=1E7508DB-AFEB-E711-8111-5065F38B3601

LogicalName=new_customentity

ownerid = EntityReference(systemuser,58a2e0ab-d945-e711-8105-5065f38a8a61)

Parameters:”CTICALLREFID”=”e41f5a4c-10e5-468d-9e6d-1d1854075929″

Condition:”[[$scriptlet.GetOfferOwnerId]]”.toLowerCase()==”[[systemuser.systemuserid]g]”.toLowerCase() && “[[phonecall.sab_offerdetail]+]”!=””

Condition Result:ActionFailed

Exception Details:Index (zero based) must be greater than or equal to zero and less than the size of the argument list.     at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)

at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)

at System.String.Format(IFormatProvider provider, String format, Object[] args)

at Microsoft.Crm.UnifiedServiceDesk.Dynamics.CRMGlobalManager.UpdateEntityAction(RequestActionEventArgs args)

at Microsoft.Crm.UnifiedServiceDesk.Dynamics.CRMGlobalManager.DoAction(RequestActionEventArgs args)

at Microsoft.Uii.Csr.Aif.HostedApplication.HostedWpfControl.HandleRequestAction(Object sender, RequestActionEventArgs args)

======================================================================

Root Cause: Error message was no where close to the actual issue, this issue was due to missing security permission. Agent was not having “Assign” permission on this custom entity.


Solution: update agent’s security role and provide “Assign” permission on custom entity.

Hope it helps.

Advertisements

One thought on “Index (zero based) must be greater than or equal to zero and less than the size of the argument list

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s