Hello,
I had a strange issue recently with an update plugin. The plugin has function to retrieve the users timezone for proper display of date/time. This is defined on the Opportunity entity.
It works fine when updating the opportunity directly. But the plugin also runs when updating the Assigned/Owner of the record. When this occurs the timezone query result throws a invalid index error. The index is used here: Entities[0].ToEntity<Entity>
(see full query below). But why does this work ok on the Opportunity but not the Owner?
Best Regards,
Tom.
var currentUserSettings = service.RetrieveMultiple(
new QueryExpression("usersettings")
{
ColumnSet = new ColumnSet("localeid", "timezonecode"),
Criteria = new FilterExpression
{
Conditions =
{
new ConditionExpression("systemuserid", ConditionOperator.EqualUserId)
}
}
}).Entities[0].ToEntity<Entity>();