0
votes

Currently, we have the following situation: Account entity contains online_status field, which can have either offline or online value. And we have an entity view, which shows only online accounts.

case1:

  • I open the view. It's empty for now;
  • I open an account form in another window and manually change online status from offline to online;
  • After clicking save, grid in view auto updates and starts showing this account

case2:

I change online status using SDK:

using (var proxy = CreateCrmProxy(broker))
{
    proxy.EnableProxyTypes();
    var crmAccount = proxy.Retrieve(Account.EntityLogicalName, aggregateId, new ColumnSet()) as Account; 

    crmAccount.OnlineStatus = //new online status;
    proxy.Update(crmAccount);
}

CreateCrmProxy method creates an instance of OrganizationServiceProxy class.

In this case, online_status field updates successfully, but grid in view stays in an old state and I need to press "refresh" button in order to see valid information.

Is it possible to fire view auto update, using the technique from case2?

Thanks in advance!

1

1 Answers

0
votes

No, you cant do this with a plugin, since plugin is purely backend and sub-grids are a front-end UI construct. Its possible you could do something hacky with calling a RetrieveMultiple after you make the update, but there wouldn't be any way to force the view to update itself.

A better option in your circumstance would be to trigger the change via javascript (a REST or SOAP Call would suffice), so that once the update is complete, then you can call a control.refresh. It would get a bit trickier on a dashboard because you wouldn't have a form to load the javascript with and the view would be in a different pane, but you could do something with a web resource and use the parent context.