@@ -758,14 +758,14 @@ private UserControl DisplayPluginControl(Lazy<IXrmToolBoxPlugin, IPluginMetadata
758758 mruItem . ConnectionName = connectionDetail . ConnectionName ;
759759 mruItem . ConnectionFileName = connectionDetail . ParentConnectionFile ? . Name ;
760760
761+ var crmSvcClient = connectionDetail . GetCrmServiceClient ( ) ;
762+
761763 if ( connectionDetail . IsFromSdkLoginCtrl )
762764 {
763- ( ( IXrmToolBoxPluginControl ) pluginControl ) . UpdateConnection ( service , connectionDetail ) ;
765+ ( ( IXrmToolBoxPluginControl ) pluginControl ) . UpdateConnection ( crmSvcClient , connectionDetail ) ;
764766 }
765767 else
766768 {
767- var crmSvcClient = connectionDetail . GetCrmServiceClient ( ) ;
768-
769769 ( ( IXrmToolBoxPluginControl ) pluginControl ) . UpdateConnection ( crmSvcClient , connectionDetail ) ;
770770 }
771771
@@ -1071,7 +1071,7 @@ private async void PluginsForm_OpenPluginRequested(object sender, PluginEventArg
10711071 return ;
10721072 }
10731073
1074- if ( service == null && e . MruInfo == null )
1074+ if ( connectionDetail == null && e . MruInfo == null )
10751075 {
10761076 var result = MessageBox . Show ( new Form { TopMost = true } , @"Do you want to connect to an organization first?" , $@ "Opening { e . Plugin . Metadata . Name } ",
10771077 MessageBoxButtons . YesNoCancel , MessageBoxIcon . Question ) ;
@@ -1699,6 +1699,7 @@ private void ApplyActiveContentDisplay()
16991699 {
17001700 ccsb . SetConnectionStatus ( pcb . ConnectionDetail != null , pcb . ConnectionDetail ) ;
17011701 connectionDetail = pcb . ConnectionDetail ;
1702+ service = pcb . ConnectionDetail . GetCrmServiceClient ( ) ;
17021703 pluginsForm . ConnectionDetail = pcb . ConnectionDetail ;
17031704 }
17041705 }
0 commit comments