diff --git a/SparkleXrmSamples/ConnectionsUI/ClientUI/View/ConnectionsView.cs b/SparkleXrmSamples/ConnectionsUI/ClientUI/View/ConnectionsView.cs index 615edd79..f7cf7ed6 100644 --- a/SparkleXrmSamples/ConnectionsUI/ClientUI/View/ConnectionsView.cs +++ b/SparkleXrmSamples/ConnectionsUI/ClientUI/View/ConnectionsView.cs @@ -11,6 +11,7 @@ using SparkleXrm.GridEditor; using System; using System.Collections.Generic; +using System.Html; using System.Runtime.CompilerServices; using Xrm; using Xrm.Sdk; @@ -37,9 +38,8 @@ public static void Init() int lcid = (int)OrganizationServiceProxy.GetUserSettings().UILanguageId; LocalisedContentLoader.FallBackLCID = 0; // Always get a resource file - LocalisedContentLoader.SupportedLCIDs.Add(1033); // English - LocalisedContentLoader.SupportedLCIDs.Add(1031); // German - + LocalisedContentLoader.SupportedLCIDs.Add(0); // Allow all LCIDs + LocalisedContentLoader.LoadContent("con_/js/Res.metadata.js", lcid, delegate() { InitLocalisedContent(); @@ -65,7 +65,8 @@ private static void InitLocalisedContent() #else parameters = PageEx.GetWebResourceData(); // The allowed lookup types for the connections - e.g. account, contact, opportunity. This must be passed as a data parameter to the webresource 'account=name&contact=fullname&opportunity=name id = ParentPage.Data.Entity.GetId(); - logicalName = ParentPage.Data.Entity.GetEntityName(); + logicalName = ParentPage.Data.Entity.GetEntityName(); + ParentPage.Data.Entity.AddOnSave(CheckForSaved); #endif EntityReference parent = new EntityReference(new Guid(id), logicalName, null); string entities = "account,contact,opportunity,systemuser"; @@ -93,7 +94,7 @@ private static void InitLocalisedContent() // Get the columsn for the view EntityQuery connectionViews = queryParser.EntityLookup["connection"]; FetchQuerySettings view = connectionViews.Views[connectionViews.Views.Keys[0]]; - string fetchXml = queryParser.GetFetchXmlParentFilter(view, parent, "record1id"); + string fetchXml = queryParser.GetFetchXmlParentFilter(view, "record1id"); vm = new ConnectionsViewModel(parent, entities.Split(","), pageSize, fetchXml); // Bind Connections grid @@ -144,6 +145,21 @@ private static void InitLocalisedContent() }); } + + private static void CheckForSaved() + { + // Check if we have the id yet + EntityReference parent = new EntityReference(new Guid(ParentPage.Data.Entity.GetId()), ParentPage.Data.Entity.GetEntityName(), null); + if (ParentPage.Ui.GetFormType() != FormTypes.Create && parent.Id != null) + { + vm.ParentRecordId.SetValue(parent); + vm.Search(); + } + else + { + Window.SetTimeout(CheckForSaved, 1000); + } + } private static void OverrideMetadata() { diff --git a/SparkleXrmSamples/ConnectionsUI/ClientUI/ViewModel/ConnectionsViewModel.cs b/SparkleXrmSamples/ConnectionsUI/ClientUI/ViewModel/ConnectionsViewModel.cs index 7af99b02..444e9b3b 100644 --- a/SparkleXrmSamples/ConnectionsUI/ClientUI/ViewModel/ConnectionsViewModel.cs +++ b/SparkleXrmSamples/ConnectionsUI/ClientUI/ViewModel/ConnectionsViewModel.cs @@ -2,6 +2,7 @@ // using ClientUI.Model; +using ClientUI.ViewModels; using jQueryApi; using KnockoutApi; using Slick; @@ -18,6 +19,7 @@ namespace ClientUI.ViewModel public class ConnectionsViewModel : ViewModelBase { #region Fields + [PreserveCase] public EntityDataViewModel Connections; [PreserveCase] @@ -27,8 +29,8 @@ public class ConnectionsViewModel : ViewModelBase [PreserveCase] public Observable ErrorMessage = Knockout.Observable(); [PreserveCase] - public Observable AllowAddNew = Knockout.Observable(true); - private EntityReference ParentRecordId; + public DependentObservable AllowAddNew; + public Observable ParentRecordId = Knockout.Observable(); private string _viewFetchXml; #endregion @@ -36,15 +38,16 @@ public class ConnectionsViewModel : ViewModelBase public ConnectionsViewModel(EntityReference parentRecordId, string[] connectToTypes, int pageSize, string viewFetchXml) { Connections = new EntityDataViewModel(pageSize, typeof(Connection), true); - ParentRecordId = parentRecordId; + ParentRecordId.SetValue(parentRecordId); _viewFetchXml = viewFetchXml; ObservableConnection connection = new ObservableConnection(connectToTypes); - connection.Record2Id.SetValue(ParentRecordId); + connection.Record2Id.SetValue(parentRecordId); ConnectionEdit = (Observable)ValidatedObservableFactory.ValidatedObservable(connection); Connections.OnDataLoaded.Subscribe(Connections_OnDataLoaded); ConnectionEdit.GetValue().OnSaveComplete += ConnectionsViewModel_OnSaveComplete; ObservableConnection.RegisterValidation(Connections.ValidationBinder); + AllowAddNew = Knockout.DependentObservable(AllowAddNewComputed); } #endregion @@ -125,6 +128,7 @@ private void ConnectionsViewModel_OnSaveComplete(string result) #region Commands public void Search() { + string parentRecordId = ParentRecordId.GetValue().Id.ToString().Replace("{", "").Replace("}", "") ; if (_viewFetchXml == null) { Connections.FetchXml = @" @@ -136,7 +140,7 @@ public void Search() - + {3} @@ -144,7 +148,7 @@ public void Search() } else { - Connections.FetchXml = _viewFetchXml; + Connections.FetchXml = _viewFetchXml.Replace(QueryParser.ParentRecordPlaceholder, parentRecordId); } Connections.Refresh(); @@ -160,6 +164,7 @@ public void RoleSearchCommand(string term, Action callback) [PreserveCase] public void AddNewCommand() { + ConnectionEdit.GetValue().Record2Id.SetValue(ParentRecordId.GetValue()); ErrorMessage.SetValue(null); ConnectionEdit.GetValue().AddNewVisible.SetValue(true); @@ -236,5 +241,13 @@ public void DeleteCommand(object data, jQueryEvent e) } #endregion + #region Computed Observables + public bool AllowAddNewComputed() + { + EntityReference parent = ParentRecordId.GetValue(); + return parent != null && parent.Id != null && parent.Id.Value != null && parent.Id.Value.Length > 0; + } + + #endregion } } diff --git a/SparkleXrmSamples/ConnectionsUI/ClientUI/ViewModel/QueryParser.cs b/SparkleXrmSamples/ConnectionsUI/ClientUI/ViewModel/QueryParser.cs index f2f99035..4246b95e 100644 --- a/SparkleXrmSamples/ConnectionsUI/ClientUI/ViewModel/QueryParser.cs +++ b/SparkleXrmSamples/ConnectionsUI/ClientUI/ViewModel/QueryParser.cs @@ -19,6 +19,7 @@ namespace ClientUI.ViewModels public class QueryParser { + public const string ParentRecordPlaceholder = "#ParentRecordPlaceholder#"; public IEnumerable Entities; public Dictionary EntityLookup = new Dictionary(); Dictionary AliasEntityLookup = new Dictionary(); @@ -375,7 +376,7 @@ public string GetFetchXmlForQuery(string entityLogicalName, string queryName, st fetchXml = fetchXml.Replace("#Query#", XmlHelper.Encode(searchTerm)); return fetchXml; } - public string GetFetchXmlParentFilter(FetchQuerySettings query, EntityReference parentId, string parentAttribute) + public string GetFetchXmlParentFilter(FetchQuerySettings query, string parentAttribute) { jQueryObject fetchElement = query.FetchXml.Find("fetch"); @@ -411,7 +412,7 @@ public string GetFetchXmlParentFilter(FetchQuerySettings query, EntityReference } // Add in the parent query filter - jQueryObject parentFilter = jQuery.FromHtml(""); + jQueryObject parentFilter = jQuery.FromHtml(""); filter.Append(parentFilter); // Add the order by placeholder for the EntityDataViewModel diff --git a/SparkleXrmSamples/ConnectionsUI/SparkleXrmCrmPackage/CrmPackage/WebResources/html/Connections.htm b/SparkleXrmSamples/ConnectionsUI/SparkleXrmCrmPackage/CrmPackage/WebResources/html/Connections.htm index 92b2b0fc..639e1960 100644 --- a/SparkleXrmSamples/ConnectionsUI/SparkleXrmCrmPackage/CrmPackage/WebResources/html/Connections.htm +++ b/SparkleXrmSamples/ConnectionsUI/SparkleXrmCrmPackage/CrmPackage/WebResources/html/Connections.htm @@ -100,7 +100,7 @@
- +
diff --git a/SparkleXrmSamples/ConnectionsUI/SparkleXrmCrmPackage/CrmPackage/WebResources/js/ClientUI.debug.js b/SparkleXrmSamples/ConnectionsUI/SparkleXrmCrmPackage/CrmPackage/WebResources/js/ClientUI.debug.js index eafe4796..9dd98899 100644 --- a/SparkleXrmSamples/ConnectionsUI/SparkleXrmCrmPackage/CrmPackage/WebResources/js/ClientUI.debug.js +++ b/SparkleXrmSamples/ConnectionsUI/SparkleXrmCrmPackage/CrmPackage/WebResources/js/ClientUI.debug.js @@ -266,7 +266,7 @@ ClientUI.ViewModels.QueryParser.prototype = { return fetchXml; }, - getFetchXmlParentFilter: function ClientUI_ViewModels_QueryParser$getFetchXmlParentFilter(query, parentId, parentAttribute) { + getFetchXmlParentFilter: function ClientUI_ViewModels_QueryParser$getFetchXmlParentFilter(query, parentAttribute) { var fetchElement = query.fetchXml.find('fetch'); fetchElement.attr('count', '{0}'); fetchElement.attr('paging-cookie', '{1}'); @@ -286,7 +286,7 @@ ClientUI.ViewModels.QueryParser.prototype = { fetchElement.find('entity').append(andFilter); } } - var parentFilter = $(""); + var parentFilter = $(""); filter.append(parentFilter); return query.fetchXml.html().replaceAll('', '{3}'); } @@ -386,22 +386,23 @@ Type.registerNamespace('ClientUI.ViewModel'); ClientUI.ViewModel.ConnectionsViewModel = function ClientUI_ViewModel_ConnectionsViewModel(parentRecordId, connectToTypes, pageSize, viewFetchXml) { this.SelectedConnection = ko.observable(); this.ErrorMessage = ko.observable(); - this.AllowAddNew = ko.observable(true); + this.parentRecordId = ko.observable(); ClientUI.ViewModel.ConnectionsViewModel.initializeBase(this); this.Connections = new SparkleXrm.GridEditor.EntityDataViewModel(pageSize, ClientUI.Model.Connection, true); - this._parentRecordId$1 = parentRecordId; + this.parentRecordId(parentRecordId); this._viewFetchXml$1 = viewFetchXml; var connection = new ClientUI.ViewModel.ObservableConnection(connectToTypes); - connection.record2id(this._parentRecordId$1); + connection.record2id(parentRecordId); this.ConnectionEdit = ko.validatedObservable(connection); this.Connections.onDataLoaded.subscribe(ss.Delegate.create(this, this._connections_OnDataLoaded$1)); this.ConnectionEdit().add_onSaveComplete(ss.Delegate.create(this, this._connectionsViewModel_OnSaveComplete$1)); ClientUI.ViewModel.ObservableConnection.registerValidation(this.Connections.validationBinder); + this.AllowAddNew = ko.dependentObservable(ss.Delegate.create(this, this.allowAddNewComputed)); } ClientUI.ViewModel.ConnectionsViewModel.prototype = { Connections: null, ConnectionEdit: null, - _parentRecordId$1: null, + AllowAddNew: null, _viewFetchXml$1: null, _connections_OnDataLoaded$1: function ClientUI_ViewModel_ConnectionsViewModel$_connections_OnDataLoaded$1(e, data) { @@ -460,11 +461,12 @@ ClientUI.ViewModel.ConnectionsViewModel.prototype = { }, search: function ClientUI_ViewModel_ConnectionsViewModel$search() { + var parentRecordId = this.parentRecordId().id.toString().replaceAll('{', '').replaceAll('}', ''); if (this._viewFetchXml$1 == null) { - this.Connections.set_fetchXml("\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {3}\r\n \r\n "); + this.Connections.set_fetchXml("\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {3}\r\n \r\n "); } else { - this.Connections.set_fetchXml(this._viewFetchXml$1); + this.Connections.set_fetchXml(this._viewFetchXml$1.replaceAll('#ParentRecordPlaceholder#', parentRecordId)); } this.Connections.refresh(); }, @@ -474,6 +476,7 @@ ClientUI.ViewModel.ConnectionsViewModel.prototype = { }, AddNewCommand: function ClientUI_ViewModel_ConnectionsViewModel$AddNewCommand() { + this.ConnectionEdit().record2id(this.parentRecordId()); this.ErrorMessage(null); this.ConnectionEdit().AddNewVisible(true); }, @@ -532,6 +535,11 @@ ClientUI.ViewModel.ConnectionsViewModel.prototype = { } })); }), null); + }, + + allowAddNewComputed: function ClientUI_ViewModel_ConnectionsViewModel$allowAddNewComputed() { + var parent = this.parentRecordId(); + return parent != null && parent.id != null && parent.id.value != null && parent.id.value.length > 0; } } @@ -689,8 +697,7 @@ ClientUI.View.ConnectionsView.Init = function ClientUI_View_ConnectionsView$Init Xrm.PageEx.majorVersion = 2013; var lcid = Xrm.Sdk.OrganizationServiceProxy.getUserSettings().uilanguageid; SparkleXrm.LocalisedContentLoader.fallBackLCID = 0; - SparkleXrm.LocalisedContentLoader.supportedLCIDs.add(1033); - SparkleXrm.LocalisedContentLoader.supportedLCIDs.add(1031); + SparkleXrm.LocalisedContentLoader.supportedLCIDs.add(0); SparkleXrm.LocalisedContentLoader.loadContent('con_/js/Res.metadata.js', lcid, function() { ClientUI.View.ConnectionsView._initLocalisedContent(); }); @@ -704,6 +711,7 @@ ClientUI.View.ConnectionsView._initLocalisedContent = function ClientUI_View_Con parameters = Xrm.PageEx.getWebResourceData(); id = window.parent.Xrm.Page.data.entity.getId(); logicalName = window.parent.Xrm.Page.data.entity.getEntityName(); + window.parent.Xrm.Page.data.entity.addOnSave(ClientUI.View.ConnectionsView._checkForSaved); var parent = new Xrm.Sdk.EntityReference(new Xrm.Sdk.Guid(id), logicalName, null); var entities = 'account,contact,opportunity,systemuser'; var $enum1 = ss.IEnumerator.getEnumerator(Object.keys(parameters)); @@ -726,7 +734,7 @@ ClientUI.View.ConnectionsView._initLocalisedContent = function ClientUI_View_Con queryParser.queryMetadata(); var connectionViews = queryParser.entityLookup['connection']; var view = connectionViews.views[Object.keys(connectionViews.views)[0]]; - var fetchXml = queryParser.getFetchXmlParentFilter(view, parent, 'record1id'); + var fetchXml = queryParser.getFetchXmlParentFilter(view, 'record1id'); ClientUI.View.ConnectionsView._vm = new ClientUI.ViewModel.ConnectionsViewModel(parent, entities.split(','), pageSize, fetchXml); var connectionsGridDataBinder = new SparkleXrm.GridEditor.GridDataViewBinder(); var columns = view.columns; @@ -760,6 +768,16 @@ ClientUI.View.ConnectionsView._initLocalisedContent = function ClientUI_View_Con ClientUI.View.ConnectionsView._vm.search(); }); } +ClientUI.View.ConnectionsView._checkForSaved = function ClientUI_View_ConnectionsView$_checkForSaved() { + var parent = new Xrm.Sdk.EntityReference(new Xrm.Sdk.Guid(window.parent.Xrm.Page.data.entity.getId()), window.parent.Xrm.Page.data.entity.getEntityName(), null); + if (window.parent.Xrm.Page.ui.getFormType() !== 10*.1 && parent.id != null) { + ClientUI.View.ConnectionsView._vm.parentRecordId(parent); + ClientUI.View.ConnectionsView._vm.search(); + } + else { + window.setTimeout(ClientUI.View.ConnectionsView._checkForSaved, 1000); + } +} ClientUI.View.ConnectionsView._overrideMetadata = function ClientUI_View_ConnectionsView$_overrideMetadata() { var getSmallIconUrl = Xrm.Sdk.Metadata.MetadataCache.getSmallIconUrl; var overrideMethod = function(typeName) { @@ -795,6 +813,7 @@ ResourceStrings.CancelButton = null; ResourceStrings.Connection_CollectionName = null; ResourceStrings.ConnectTo = null; ResourceStrings.Role = null; +ClientUI.ViewModels.QueryParser.parentRecordPlaceholder = '#ParentRecordPlaceholder#'; ClientUI.Model.Connection.logicalName = 'connection'; ClientUI.View.ConnectionsView._vm = null; ClientUI.View.ConnectionsView._connectionsGrid = null; diff --git a/SparkleXrmSamples/ConnectionsUI/SparkleXrmCrmPackage/CrmPackage/WebResources/js/ClientUI.js b/SparkleXrmSamples/ConnectionsUI/SparkleXrmCrmPackage/CrmPackage/WebResources/js/ClientUI.js index 304588fb..ba8eefda 100644 --- a/SparkleXrmSamples/ConnectionsUI/SparkleXrmCrmPackage/CrmPackage/WebResources/js/ClientUI.js +++ b/SparkleXrmSamples/ConnectionsUI/SparkleXrmCrmPackage/CrmPackage/WebResources/js/ClientUI.js @@ -6,19 +6,19 @@ ClientUI.ViewModels.QueryParser.prototype={entities:null,getQuickFinds:function( var $1_0=$p1_1.getAttribute('name').toString();var $1_1=$1_0;var $1_2;var $1_3;var $1_4=$1_0.indexOf('.');if($1_4>-1){var $1_8=$1_0.substr(0,$1_4);$1_1=$1_0.substr($1_4+1);$1_2=this.$0[$1_8];}else{$1_2=$p0;}if(Object.keyExists($1_2.attributes,$1_1)){$1_3=$1_2.attributes[$1_1];}else{$1_3={};$1_3.columns=[];$1_3.logicalName=$1_1;$1_2.attributes[$1_3.logicalName]=$1_3;}var $1_5=parseInt($p1_1.getAttribute('width').toString());var $1_6=$p1_1.getAttribute('disableSorting');var $1_7=SparkleXrm.GridEditor.GridDataViewBinder.newColumn($1_3.logicalName,$1_3.logicalName,$1_5);$1_7.sortable=!($1_6!=null&&$1_6.toString()==='1');$1_3.columns.add($1_7);$2.add($1_7);}));return $2;},queryMetadata:function(){var $0=new Xrm.Sdk.Metadata.Query.MetadataQueryBuilder();var $1=[];var $2=[];var $enum1=ss.IEnumerator.getEnumerator(Object.keys(this.entityLookup));while($enum1.moveNext()){var $4=$enum1.current;$1.add($4);var $5=this.entityLookup[$4];var $enum2=ss.IEnumerator.getEnumerator(Object.keys($5.attributes));while($enum2.moveNext()){var $6=$enum2.current;var $7=$5.attributes[$6];var $8=$7.logicalName;var $9=$8.indexOf('.');if($5.aliasName!=null&&$9>-1){$8=$8.substr($9);}$2.add($8);}}$0.addEntities($1,['Attributes','DisplayName','DisplayCollectionName','PrimaryImageAttribute']);$0.addAttributes($2,['DisplayName','AttributeType','IsPrimaryName']);$0.setLanguage(USER_LANGUAGE_CODE);var $3=Xrm.Sdk.OrganizationServiceProxy.execute($0.request);var $enum3=ss.IEnumerator.getEnumerator($3.entityMetadata);while($enum3.moveNext()){var $A=$enum3.current;var $B=this.entityLookup[$A.logicalName];$B.displayName=$A.displayName.userLocalizedLabel.label;$B.displayCollectionName=$A.displayCollectionName.userLocalizedLabel.label;$B.primaryImageAttribute=$A.primaryImageAttribute;$B.entityTypeCode=$A.objectTypeCode;var $enum4=ss.IEnumerator.getEnumerator($A.attributes);while($enum4.moveNext()){var $C=$enum4.current;if(Object.keyExists($B.attributes,$C.logicalName)){var $D=$B.attributes[$C.logicalName];$D.attributeType=$C.attributeType;switch($C.attributeType){case 'Lookup':case 'Picklist':case 'Customer':case 'Owner':case 'Status':case 'State':case 'Boolean':this.$1[$C.logicalName]=$D;break;}$D.isPrimaryName=$C.isPrimaryName;var $enum5=ss.IEnumerator.getEnumerator($D.columns);while($enum5.moveNext()){var $E=$enum5.current;$E.name=$C.displayName.userLocalizedLabel.label;$E.dataType=($C.isPrimaryName)?'PrimaryNameLookup':$C.attributeType;}}}}},$5:function($p0){var $0=$p0.fetchXml;var $1=$0.find('entity');var $2=$1.attr('name');var $3;if(!Object.keyExists(this.entityLookup,$2)){$3={};$3.logicalName=$2;$3.attributes={};this.entityLookup[$3.logicalName]=$3;}else{$3=this.entityLookup[$2];}var $4=$1.find('link-entity');$4.each(ss.Delegate.create(this,function($p1_0,$p1_1){ var $1_0={};$1_0.attributes={};$1_0.aliasName=$p1_1.getAttribute('alias').toString();$1_0.logicalName=$p1_1.getAttribute('name').toString();if(!Object.keyExists(this.entityLookup,$1_0.logicalName)){this.entityLookup[$1_0.logicalName]=$1_0;}else{var $1_1=$1_0.aliasName;$1_0=this.entityLookup[$1_0.logicalName];$1_0.aliasName=$1_1;}if(!Object.keyExists(this.$0,$1_0.aliasName)){this.$0[$1_0.aliasName]=$1_0;}}));$p0.rootEntity=$3;var $5=$0.find("filter[isquickfindfields='1']");$5.first().children().each(function($p1_0,$p1_1){ $2=$p1_1.getAttribute('attribute').toString();var $1_0=$($p1_1);var $1_1=$1_0.parents('link-entity');if(!Object.keyExists($p0.rootEntity.attributes,$2)){var $1_2={};$1_2.logicalName=$2;$1_2.columns=[];$p0.rootEntity.attributes[$2]=$1_2;}});},getFetchXmlForQuery:function(entityLogicalName,queryName,searchTerm){var $0;if(queryName==='QuickFind'){$0=this.entityLookup[entityLogicalName].quickFindQuery;}else{$0=this.entityLookup[entityLogicalName].views[queryName];}var $1=$0.fetchXml.find('fetch');$1.attr('distinct','true');$1.attr('no-lock','true');var $2=$1.find('order');$2.remove();var $3=$1.find("filter[isquickfindfields='1']");$3.first().children().each(ss.Delegate.create(this,function($p1_0,$p1_1){ -var $1_0=$p1_1.getAttribute('attribute').toString();if(Object.keyExists(this.$1,$1_0)){$p1_1.setAttribute('attribute',$1_0+'name');}}));var $4=$0.fetchXml.html();$4=$4.replaceAll('#Query#',Xrm.Sdk.XmlHelper.encode(searchTerm));return $4;},getFetchXmlParentFilter:function(query,parentId,parentAttribute){var $0=query.fetchXml.find('fetch');$0.attr('count','{0}');$0.attr('paging-cookie','{1}');$0.attr('page','{2}');$0.attr('returntotalrecordcount','true');$0.attr('distinct','true');$0.attr('no-lock','true');var $1=$0.find('order');$1.remove();var $2=$0.find('entity>filter');if($2!=null){var $4=$2.attr('type');if($4==='or'){var $5=$(""+$2.html()+'');$2.remove();$2=$5;$0.find('entity').append($5);}}var $3=$("");$2.append($3);return query.fetchXml.html().replaceAll('','{3}');}} +var $1_0=$p1_1.getAttribute('attribute').toString();if(Object.keyExists(this.$1,$1_0)){$p1_1.setAttribute('attribute',$1_0+'name');}}));var $4=$0.fetchXml.html();$4=$4.replaceAll('#Query#',Xrm.Sdk.XmlHelper.encode(searchTerm));return $4;},getFetchXmlParentFilter:function(query,parentAttribute){var $0=query.fetchXml.find('fetch');$0.attr('count','{0}');$0.attr('paging-cookie','{1}');$0.attr('page','{2}');$0.attr('returntotalrecordcount','true');$0.attr('distinct','true');$0.attr('no-lock','true');var $1=$0.find('order');$1.remove();var $2=$0.find('entity>filter');if($2!=null){var $4=$2.attr('type');if($4==='or'){var $5=$(""+$2.html()+'');$2.remove();$2=$5;$0.find('entity').append($5);}}var $3=$("");$2.append($3);return query.fetchXml.html().replaceAll('','{3}');}} Type.registerNamespace('ClientUI.View.GridPlugins');ClientUI.View.GridPlugins.RowHoverPlugin=function(containerDivId){this.$2=containerDivId;} ClientUI.View.GridPlugins.RowHoverPlugin.prototype={$0:null,$1:null,$2:null,$3:false,destroy:function(){this.$1.remove();},init:function(grid){this.$0=grid;this.$1=$('#'+this.$2);this.$1.mouseenter(ss.Delegate.create(this,function($p1_0){ this.$3=false;}));$('#grid').find('.slick-viewport').append(this.$1);(this.$0.onMouseEnter).subscribe(ss.Delegate.create(this,this.handleMouseEnter));(this.$0.onMouseLeave).subscribe(ss.Delegate.create(this,this.handleMouseLeave));},handleMouseLeave:function(e,item){this.$3=true;window.setTimeout(ss.Delegate.create(this,function(){ if(this.$3){this.$1.fadeOut();}}),500);},handleMouseEnter:function(e,item){var $0=this.$0.getCellFromEvent(e);if($0!=null){this.$3=false;var $1=this.$0.getDataItem($0.row);if($1!=null){this.$0.getGridPosition();var $2=this.$0.getViewport().rightPx;var $3=this.$0.getViewport().leftPx;var $4=$(this.$0.getCellNode($0.row,$0.cell));var $5=this.$1.width();var $6=$4.parent().width();if($2<$6+$5){$6=$2-$5;}var $7=0;$4.parent().append(this.$1);this.$1.css('left',$6.toString()+'px');this.$1.css('top',$7.toString()+'px');this.$1.css('display','block');this.$1.attr('rowId',$1.id);}}}} Type.registerNamespace('ClientUI.Model');ClientUI.Model.Connection=function(){ClientUI.Model.Connection.initializeBase(this,['connection']);} ClientUI.Model.Connection.prototype={connectionid:null,record1id:null,record2id:null,record1roleid:null,record2roleid:null,description:null,effectivestart:null,effectiveend:null} -Type.registerNamespace('ClientUI.ViewModel');ClientUI.ViewModel.ConnectionsViewModel=function(parentRecordId,connectToTypes,pageSize,viewFetchXml){this.SelectedConnection=ko.observable();this.ErrorMessage=ko.observable();this.AllowAddNew=ko.observable(true);ClientUI.ViewModel.ConnectionsViewModel.initializeBase(this);this.Connections=new SparkleXrm.GridEditor.EntityDataViewModel(pageSize,ClientUI.Model.Connection,true);this.$1_0=parentRecordId;this.$1_1=viewFetchXml;var $0=new ClientUI.ViewModel.ObservableConnection(connectToTypes);$0.record2id(this.$1_0);this.ConnectionEdit=ko.validatedObservable($0);this.Connections.onDataLoaded.subscribe(ss.Delegate.create(this,this.$1_2));this.ConnectionEdit().add_onSaveComplete(ss.Delegate.create(this,this.$1_4));ClientUI.ViewModel.ObservableConnection.registerValidation(this.Connections.validationBinder);} -ClientUI.ViewModel.ConnectionsViewModel.prototype={Connections:null,ConnectionEdit:null,$1_0:null,$1_1:null,$1_2:function($p0,$p1){var $0=$p1;for(var $1=0;$1<$0.to;$1++){var $2=this.Connections.getItem($1);if($2==null){return;}$2.add_propertyChanged(ss.Delegate.create(this,this.$1_3));}},$1_3:function($p0,$p1){var $0=new ClientUI.Model.Connection();var $1=$p0;$0.connectionid=new Xrm.Sdk.Guid($1.id);var $2=false;switch($p1.propertyName){case 'record2roleid':$0.record2roleid=$1.record2roleid;$2=true;break;case 'description':$0.description=$1.description;$2=true;break;case 'effectivestart':$0.effectivestart=$1.effectivestart;$2=true;break;case 'effectiveend':$0.effectiveend=$1.effectiveend;$2=true;break;}if($2){Xrm.Sdk.OrganizationServiceProxy.beginUpdate($0,ss.Delegate.create(this,function($p1_0){ -try{Xrm.Sdk.OrganizationServiceProxy.endUpdate($p1_0);this.ErrorMessage(null);}catch($1_0){this.ErrorMessage($1_0.message);}}));}},$1_4:function($p0){if($p0==null){this.Connections.reset();this.Connections.refresh();}this.ErrorMessage($p0);},search:function(){if(this.$1_1==null){this.Connections.set_fetchXml("\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {3}\r\n \r\n ");}else{this.Connections.set_fetchXml(this.$1_1);}this.Connections.refresh();},RoleSearchCommand:function(term,callback){ClientUI.ViewModel.ObservableConnection.RoleSearch(term,callback,this.SelectedConnection().record2id.logicalName);},AddNewCommand:function(){this.ErrorMessage(null);this.ConnectionEdit().AddNewVisible(true);},OpenAssociatedSubGridCommand:function(){var $0=window.parent.Xrm.Page.ui.navigation.items.get('navConnections');$0.setFocus();},DeleteSelectedCommand:function(){var $0=SparkleXrm.GridEditor.DataViewBase.rangesToRows(this.Connections.getSelectedRows());if(!$0.length){return;}Xrm.Utility.confirmDialog(String.format(ResourceStrings.ConfirmDeleteSelectedConnection,$0.length),ss.Delegate.create(this,function(){ +Type.registerNamespace('ClientUI.ViewModel');ClientUI.ViewModel.ConnectionsViewModel=function(parentRecordId,connectToTypes,pageSize,viewFetchXml){this.SelectedConnection=ko.observable();this.ErrorMessage=ko.observable();this.parentRecordId=ko.observable();ClientUI.ViewModel.ConnectionsViewModel.initializeBase(this);this.Connections=new SparkleXrm.GridEditor.EntityDataViewModel(pageSize,ClientUI.Model.Connection,true);this.parentRecordId(parentRecordId);this.$1_0=viewFetchXml;var $0=new ClientUI.ViewModel.ObservableConnection(connectToTypes);$0.record2id(parentRecordId);this.ConnectionEdit=ko.validatedObservable($0);this.Connections.onDataLoaded.subscribe(ss.Delegate.create(this,this.$1_1));this.ConnectionEdit().add_onSaveComplete(ss.Delegate.create(this,this.$1_3));ClientUI.ViewModel.ObservableConnection.registerValidation(this.Connections.validationBinder);this.AllowAddNew=ko.dependentObservable(ss.Delegate.create(this,this.allowAddNewComputed));} +ClientUI.ViewModel.ConnectionsViewModel.prototype={Connections:null,ConnectionEdit:null,AllowAddNew:null,$1_0:null,$1_1:function($p0,$p1){var $0=$p1;for(var $1=0;$1<$0.to;$1++){var $2=this.Connections.getItem($1);if($2==null){return;}$2.add_propertyChanged(ss.Delegate.create(this,this.$1_2));}},$1_2:function($p0,$p1){var $0=new ClientUI.Model.Connection();var $1=$p0;$0.connectionid=new Xrm.Sdk.Guid($1.id);var $2=false;switch($p1.propertyName){case 'record2roleid':$0.record2roleid=$1.record2roleid;$2=true;break;case 'description':$0.description=$1.description;$2=true;break;case 'effectivestart':$0.effectivestart=$1.effectivestart;$2=true;break;case 'effectiveend':$0.effectiveend=$1.effectiveend;$2=true;break;}if($2){Xrm.Sdk.OrganizationServiceProxy.beginUpdate($0,ss.Delegate.create(this,function($p1_0){ +try{Xrm.Sdk.OrganizationServiceProxy.endUpdate($p1_0);this.ErrorMessage(null);}catch($1_0){this.ErrorMessage($1_0.message);}}));}},$1_3:function($p0){if($p0==null){this.Connections.reset();this.Connections.refresh();}this.ErrorMessage($p0);},search:function(){var $0=this.parentRecordId().id.toString().replaceAll('{','').replaceAll('}','');if(this.$1_0==null){this.Connections.set_fetchXml("\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {3}\r\n \r\n ");}else{this.Connections.set_fetchXml(this.$1_0.replaceAll('#ParentRecordPlaceholder#',$0));}this.Connections.refresh();},RoleSearchCommand:function(term,callback){ClientUI.ViewModel.ObservableConnection.RoleSearch(term,callback,this.SelectedConnection().record2id.logicalName);},AddNewCommand:function(){this.ConnectionEdit().record2id(this.parentRecordId());this.ErrorMessage(null);this.ConnectionEdit().AddNewVisible(true);},OpenAssociatedSubGridCommand:function(){var $0=window.parent.Xrm.Page.ui.navigation.items.get('navConnections');$0.setFocus();},DeleteSelectedCommand:function(){var $0=SparkleXrm.GridEditor.DataViewBase.rangesToRows(this.Connections.getSelectedRows());if(!$0.length){return;}Xrm.Utility.confirmDialog(String.format(ResourceStrings.ConfirmDeleteSelectedConnection,$0.length),ss.Delegate.create(this,function(){ var $1_0=[];var $enum1=ss.IEnumerator.getEnumerator($0);while($enum1.moveNext()){var $1_1=$enum1.current;$1_0.add(this.Connections.getItem($1_1));}try{var $enum2=ss.IEnumerator.getEnumerator($1_0);while($enum2.moveNext()){var $1_2=$enum2.current;Xrm.Sdk.OrganizationServiceProxy.delete_($1_2.logicalName,new Xrm.Sdk.Guid($1_2.id));}}catch($1_3){this.ErrorMessage($1_3.toString());}this.Connections.raiseOnSelectedRowsChanged(null);this.Connections.reset();this.Connections.refresh();}),null);},DeleteCommand:function(data,e){Xrm.Utility.confirmDialog(ResourceStrings.ConfirmDeleteConnection,ss.Delegate.create(this,function(){ var $1_0=e.target.parentNode.getAttribute('rowId').toString();Xrm.Sdk.OrganizationServiceProxy.beginDelete(ClientUI.Model.Connection.logicalName,new Xrm.Sdk.Guid($1_0),ss.Delegate.create(this,function($p2_0){ -try{Xrm.Sdk.OrganizationServiceProxy.endDelete($p2_0);var $enum1=ss.IEnumerator.getEnumerator(this.Connections.get_data());while($enum1.moveNext()){var $2_0=$enum1.current;if($2_0.id===$1_0){this.Connections.removeItem($2_0);break;}}this.Connections.refresh();}catch($2_1){this.ErrorMessage($2_1.message);}}));}),null);}} +try{Xrm.Sdk.OrganizationServiceProxy.endDelete($p2_0);var $enum1=ss.IEnumerator.getEnumerator(this.Connections.get_data());while($enum1.moveNext()){var $2_0=$enum1.current;if($2_0.id===$1_0){this.Connections.removeItem($2_0);break;}}this.Connections.refresh();}catch($2_1){this.ErrorMessage($2_1.message);}}));}),null);},allowAddNewComputed:function(){var $0=this.parentRecordId();return $0!=null&&$0.id!=null&&$0.id.value!=null&&$0.id.value.length>0;}} ClientUI.ViewModel.ObservableConnection=function(types){this.AddNewVisible=ko.observable(false);this.connectiondid=ko.observable();this.record1id=ko.observable();this.record2id=ko.observable();this.record1roleid=ko.observable();this.record2roleid=ko.observable();this.description=ko.observable();ClientUI.ViewModel.ObservableConnection.initializeBase(this);this.$1_2=types;ClientUI.ViewModel.ObservableConnection.registerValidation(new SparkleXrm.ObservableValidationBinder(this));} ClientUI.ViewModel.ObservableConnection.RoleSearch=function(term,callback,typeName){var $0='';if(typeName!=null){var $2=Mscrm.EntityPropUtil.EntityTypeName2CodeMap[typeName];$0=String.format("\r\n \r\n \r\n ",$2);}var $1="\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {1}\r\n \r\n \r\n \r\n \r\n \r\n ";$1=String.format($1,Xrm.Sdk.XmlHelper.encode(term),$0);Xrm.Sdk.OrganizationServiceProxy.beginRetrieveMultiple($1,function($p1_0){ var $1_0=Xrm.Sdk.OrganizationServiceProxy.endRetrieveMultiple($p1_0,Xrm.Sdk.Entity);callback($1_0);});} @@ -33,12 +33,13 @@ return String.compare($p2_0.getAttributeValueString('name'),$p2_1.getAttributeVa var $1_0=Xrm.Sdk.OrganizationServiceProxy.endRetrieveMultiple($p1_0,Xrm.Sdk.Entity);$1_0.set_entityName($p2);$p1($1_0);});},RoleSearchCommand:function(term,callback){var $0=this.record1id();ClientUI.ViewModel.ObservableConnection.RoleSearch(term,callback,($0!=null)?$0.logicalName:null);},SaveCommand:function(){if(!(this).isValid()){(this).errors.showAllMessages(true);return;}this.isBusy(true);this.AddNewVisible(false);var $0=new ClientUI.Model.Connection();$0.record1id=this.record1id();$0.record2id=this.record2id();$0.record1roleid=this.record1roleid();$0.record2roleid=this.record2roleid();Xrm.Sdk.OrganizationServiceProxy.beginCreate($0,ss.Delegate.create(this,function($p1_0){ try{this.connectiondid(Xrm.Sdk.OrganizationServiceProxy.endCreate($p1_0));this.$1_0(null);this.record1id(null);this.record1roleid(null);(this).errors.showAllMessages(false);}catch($1_0){this.$1_0($1_0.message);}finally{this.isBusy(false);}}));},CancelCommand:function(){this.AddNewVisible(false);}} Type.registerNamespace('ClientUI.View');ClientUI.View.ConnectionsView=function(){} -ClientUI.View.ConnectionsView.Init=function(){Xrm.PageEx.majorVersion=2013;var $0=Xrm.Sdk.OrganizationServiceProxy.getUserSettings().uilanguageid;SparkleXrm.LocalisedContentLoader.fallBackLCID=0;SparkleXrm.LocalisedContentLoader.supportedLCIDs.add(1033);SparkleXrm.LocalisedContentLoader.supportedLCIDs.add(1031);SparkleXrm.LocalisedContentLoader.loadContent('con_/js/Res.metadata.js',$0,function(){ +ClientUI.View.ConnectionsView.Init=function(){Xrm.PageEx.majorVersion=2013;var $0=Xrm.Sdk.OrganizationServiceProxy.getUserSettings().uilanguageid;SparkleXrm.LocalisedContentLoader.fallBackLCID=0;SparkleXrm.LocalisedContentLoader.supportedLCIDs.add(0);SparkleXrm.LocalisedContentLoader.loadContent('con_/js/Res.metadata.js',$0,function(){ ClientUI.View.ConnectionsView.$1();});} -ClientUI.View.ConnectionsView.$1=function(){var $0;var $1;var $2;var $3=10;var $4=null;$0=Xrm.PageEx.getWebResourceData();$1=window.parent.Xrm.Page.data.entity.getId();$2=window.parent.Xrm.Page.data.entity.getEntityName();var $5=new Xrm.Sdk.EntityReference(new Xrm.Sdk.Guid($1),$2,null);var $6='account,contact,opportunity,systemuser';var $enum1=ss.IEnumerator.getEnumerator(Object.keys($0));while($enum1.moveNext()){var $D=$enum1.current;switch($D.toLowerCase()){case 'entities':$6=$0[$D];break;case 'pageSize':$3=parseInt($0[$D]);break;case 'view':$4=$0[$D];break;}}var $7=new ClientUI.ViewModels.QueryParser(['connection']);$7.getView('connection',$4);$7.queryMetadata();var $8=$7.entityLookup['connection'];var $9=$8.views[Object.keys($8.views)[0]];var $A=$7.getFetchXmlParentFilter($9,$5,'record1id');ClientUI.View.ConnectionsView.vm=new ClientUI.ViewModel.ConnectionsViewModel($5,$6.split(','),$3,$A);var $B=new SparkleXrm.GridEditor.GridDataViewBinder();var $C=$9.columns;var $enum2=ss.IEnumerator.getEnumerator($C);while($enum2.moveNext()){var $E=$enum2.current;switch($E.field){case 'record2roleid':SparkleXrm.GridEditor.XrmLookupEditor.bindColumn($E,ss.Delegate.create(ClientUI.View.ConnectionsView.vm,ClientUI.View.ConnectionsView.vm.RoleSearchCommand),'connectionroleid','name,category','');break;case 'description':SparkleXrm.GridEditor.XrmTextEditor.bindColumn($E);break;case 'effectivestart':case 'effectiveend':SparkleXrm.GridEditor.XrmDateEditor.bindColumn($E,true);break;}}ClientUI.View.ConnectionsView.$0=$B.dataBindXrmGrid(ClientUI.View.ConnectionsView.vm.Connections,$C,'container','pager',true,false);ClientUI.View.ConnectionsView.$0.onActiveCellChanged.subscribe(function($p1_0,$p1_1){ -var $1_0=$p1_1;ClientUI.View.ConnectionsView.vm.SelectedConnection(ClientUI.View.ConnectionsView.$0.getDataItem($1_0.row));});$B.bindClickHandler(ClientUI.View.ConnectionsView.$0);SparkleXrm.ViewBase.registerViewModel(ClientUI.View.ConnectionsView.vm);ClientUI.View.ConnectionsView.$2();$(window).resize(ClientUI.View.ConnectionsView.$3);$(function(){ -ClientUI.View.ConnectionsView.$3(null);ClientUI.View.ConnectionsView.vm.search();});} -ClientUI.View.ConnectionsView.$2=function(){var $0=Xrm.Sdk.Metadata.MetadataCache.getSmallIconUrl;var $1=function($p1_0){ +ClientUI.View.ConnectionsView.$1=function(){var $0;var $1;var $2;var $3=10;var $4=null;$0=Xrm.PageEx.getWebResourceData();$1=window.parent.Xrm.Page.data.entity.getId();$2=window.parent.Xrm.Page.data.entity.getEntityName();window.parent.Xrm.Page.data.entity.addOnSave(ClientUI.View.ConnectionsView.$2);var $5=new Xrm.Sdk.EntityReference(new Xrm.Sdk.Guid($1),$2,null);var $6='account,contact,opportunity,systemuser';var $enum1=ss.IEnumerator.getEnumerator(Object.keys($0));while($enum1.moveNext()){var $D=$enum1.current;switch($D.toLowerCase()){case 'entities':$6=$0[$D];break;case 'pageSize':$3=parseInt($0[$D]);break;case 'view':$4=$0[$D];break;}}var $7=new ClientUI.ViewModels.QueryParser(['connection']);$7.getView('connection',$4);$7.queryMetadata();var $8=$7.entityLookup['connection'];var $9=$8.views[Object.keys($8.views)[0]];var $A=$7.getFetchXmlParentFilter($9,'record1id');ClientUI.View.ConnectionsView.vm=new ClientUI.ViewModel.ConnectionsViewModel($5,$6.split(','),$3,$A);var $B=new SparkleXrm.GridEditor.GridDataViewBinder();var $C=$9.columns;var $enum2=ss.IEnumerator.getEnumerator($C);while($enum2.moveNext()){var $E=$enum2.current;switch($E.field){case 'record2roleid':SparkleXrm.GridEditor.XrmLookupEditor.bindColumn($E,ss.Delegate.create(ClientUI.View.ConnectionsView.vm,ClientUI.View.ConnectionsView.vm.RoleSearchCommand),'connectionroleid','name,category','');break;case 'description':SparkleXrm.GridEditor.XrmTextEditor.bindColumn($E);break;case 'effectivestart':case 'effectiveend':SparkleXrm.GridEditor.XrmDateEditor.bindColumn($E,true);break;}}ClientUI.View.ConnectionsView.$0=$B.dataBindXrmGrid(ClientUI.View.ConnectionsView.vm.Connections,$C,'container','pager',true,false);ClientUI.View.ConnectionsView.$0.onActiveCellChanged.subscribe(function($p1_0,$p1_1){ +var $1_0=$p1_1;ClientUI.View.ConnectionsView.vm.SelectedConnection(ClientUI.View.ConnectionsView.$0.getDataItem($1_0.row));});$B.bindClickHandler(ClientUI.View.ConnectionsView.$0);SparkleXrm.ViewBase.registerViewModel(ClientUI.View.ConnectionsView.vm);ClientUI.View.ConnectionsView.$3();$(window).resize(ClientUI.View.ConnectionsView.$4);$(function(){ +ClientUI.View.ConnectionsView.$4(null);ClientUI.View.ConnectionsView.vm.search();});} +ClientUI.View.ConnectionsView.$2=function(){var $0=new Xrm.Sdk.EntityReference(new Xrm.Sdk.Guid(window.parent.Xrm.Page.data.entity.getId()),window.parent.Xrm.Page.data.entity.getEntityName(),null);if(window.parent.Xrm.Page.ui.getFormType()!==10*.1&&$0.id!=null){ClientUI.View.ConnectionsView.vm.parentRecordId($0);ClientUI.View.ConnectionsView.vm.search();}else{window.setTimeout(ClientUI.View.ConnectionsView.$2,1000);}} +ClientUI.View.ConnectionsView.$3=function(){var $0=Xrm.Sdk.Metadata.MetadataCache.getSmallIconUrl;var $1=function($p1_0){ switch($p1_0){case 'connectionrole':return '/_imgs/ico_16_3234.gif';default:return $0($p1_0);}};Xrm.Sdk.Metadata.MetadataCache.getSmallIconUrl=$1;} -ClientUI.View.ConnectionsView.$3=function($p0){var $0=$(window).height();var $1=$(window).width();$('#container').height($0-64).width($1-1);ClientUI.View.ConnectionsView.$0.resizeCanvas();} -ResourceStrings.registerClass('ResourceStrings');ClientUI.ViewModels.QueryParser.registerClass('ClientUI.ViewModels.QueryParser');ClientUI.View.GridPlugins.RowHoverPlugin.registerClass('ClientUI.View.GridPlugins.RowHoverPlugin',null,Object);ClientUI.Model.Connection.registerClass('ClientUI.Model.Connection',Xrm.Sdk.Entity);ClientUI.ViewModel.ConnectionsViewModel.registerClass('ClientUI.ViewModel.ConnectionsViewModel',SparkleXrm.ViewModelBase);ClientUI.ViewModel.ObservableConnection.registerClass('ClientUI.ViewModel.ObservableConnection',SparkleXrm.ViewModelBase);ClientUI.View.ConnectionsView.registerClass('ClientUI.View.ConnectionsView');ResourceStrings.ConfirmDeleteSelectedConnection=null;ResourceStrings.ConfirmDeleteConnection=null;ResourceStrings.RequiredMessage=null;ResourceStrings.SaveButton=null;ResourceStrings.CancelButton=null;ResourceStrings.Connection_CollectionName=null;ResourceStrings.ConnectTo=null;ResourceStrings.Role=null;ClientUI.Model.Connection.logicalName='connection';ClientUI.View.ConnectionsView.vm=null;ClientUI.View.ConnectionsView.$0=null;})(window.xrmjQuery); \ No newline at end of file +ClientUI.View.ConnectionsView.$4=function($p0){var $0=$(window).height();var $1=$(window).width();$('#container').height($0-64).width($1-1);ClientUI.View.ConnectionsView.$0.resizeCanvas();} +ResourceStrings.registerClass('ResourceStrings');ClientUI.ViewModels.QueryParser.registerClass('ClientUI.ViewModels.QueryParser');ClientUI.View.GridPlugins.RowHoverPlugin.registerClass('ClientUI.View.GridPlugins.RowHoverPlugin',null,Object);ClientUI.Model.Connection.registerClass('ClientUI.Model.Connection',Xrm.Sdk.Entity);ClientUI.ViewModel.ConnectionsViewModel.registerClass('ClientUI.ViewModel.ConnectionsViewModel',SparkleXrm.ViewModelBase);ClientUI.ViewModel.ObservableConnection.registerClass('ClientUI.ViewModel.ObservableConnection',SparkleXrm.ViewModelBase);ClientUI.View.ConnectionsView.registerClass('ClientUI.View.ConnectionsView');ResourceStrings.ConfirmDeleteSelectedConnection=null;ResourceStrings.ConfirmDeleteConnection=null;ResourceStrings.RequiredMessage=null;ResourceStrings.SaveButton=null;ResourceStrings.CancelButton=null;ResourceStrings.Connection_CollectionName=null;ResourceStrings.ConnectTo=null;ResourceStrings.Role=null;ClientUI.ViewModels.QueryParser.parentRecordPlaceholder='#ParentRecordPlaceholder#';ClientUI.Model.Connection.logicalName='connection';ClientUI.View.ConnectionsView.vm=null;ClientUI.View.ConnectionsView.$0=null;})(window.xrmjQuery); \ No newline at end of file diff --git a/SparkleXrmSamples/ConnectionsUI/SparkleXrmCrmPackage/CrmPackage/WebResources/js/Res.metadata_1033.js b/SparkleXrmSamples/ConnectionsUI/SparkleXrmCrmPackage/CrmPackage/WebResources/js/Res.metadata_1033.js index 32384287..ece77bdc 100644 --- a/SparkleXrmSamples/ConnectionsUI/SparkleXrmCrmPackage/CrmPackage/WebResources/js/Res.metadata_1033.js +++ b/SparkleXrmSamples/ConnectionsUI/SparkleXrmCrmPackage/CrmPackage/WebResources/js/Res.metadata_1033.js @@ -2,7 +2,9 @@ ResourceStrings.RequiredMessage = 'Required'; ResourceStrings.SaveButton = 'Save'; ResourceStrings.CancelButton = 'Cancel'; - +ResourceStrings.Connection_CollectionName = 'Connections'; +ResourceStrings.ConnectTo = 'Connect To'; +ResourceStrings.Role = 'Role'; /*metadata ResourceStrings.Connection_CollectionName = <@connection.DisplayCollectionName@>; ResourceStrings.ConnectTo = <@connection.record2id.DisplayName@>; diff --git a/SparkleXrmSamples/RefreshedConnectionsUI_1_0_managed.zip b/SparkleXrmSamples/RefreshedConnectionsUI_1_0_managed.zip new file mode 100644 index 00000000..5de70593 Binary files /dev/null and b/SparkleXrmSamples/RefreshedConnectionsUI_1_0_managed.zip differ