This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Assign ADS Preferred Account schedule

Hello Team,

We have an schedule to check Ispreferred flag for ADS account in order to update Manager details in AD.

Condition: 

UID_Person in ( Select UID_Person from Person

Where (SELECT top 1 IsPreferredAccount FROM [ADSAccount] Where UID_Person =
Person.UID_Person and UID_TSBBehavior in (select UID_TSBBehavior from
TSBBehavior where ITDataUsage = 1)
and AccountDisabled = 0 and UID_ADSAccount in (select UID_ADSAccount from
EX0MailBox) and Mail is not null
Order by IsPreferredAccount desc) = 0 and IsInActive = 0)

But the job chain for few Person records is going to frozen state with below error

Assign ADS Preferred Account

ErrorMessages = (2018-10-18 10:23:44.693) [810222] Error executing script 'AJG_UpdatePreferredAccount'.
[System.ArgumentOutOfRangeException] Length cannot be less than zero.
Parameter name: length
at StdioProcessor.StdioProcessor._Execute(Job job)
at VI.JobService.JobComponents.ScriptComponent.Activate(String task)
at VI.JobService.JobComponents.ScriptComponent._TaskScriptExec()
at VI.DB.Scripting.ScriptRunner.Eval(String key, Object[] parameters)
---- Start of Inner Exception ----
at DynScripts.Scripts_v98rB8OINvvGwATjOhskHgtUA.AJG_UpdatePreferredAccount(String UID_Person)
at System.String.Substring(Int32 startIndex, Int32 length)

Can someone check and provide me an feedback.

Thanks in Advance

BR

Baji

  • According to the error message the error message is coming from inside of your script. There must be a call for String.SubString where the length is less than zero.

    I suggest you take a look at your script. I would debug the script with the parameter value for UID_Person (according to your logs or Job History) that caused the issue.