diff --git a/SparkleXrmSource/CrmPackage/WebResources/sparkle_/js/SparkleXrm.js b/SparkleXrmSource/CrmPackage/WebResources/sparkle_/js/SparkleXrm.js index f576690f..8e439387 100644 --- a/SparkleXrmSource/CrmPackage/WebResources/sparkle_/js/SparkleXrm.js +++ b/SparkleXrmSource/CrmPackage/WebResources/sparkle_/js/SparkleXrm.js @@ -30,7 +30,8 @@ Xrm.TabItem.prototype={sections:null,getDisplayState:function(){return 'expanded Xrm.TabSection=function(){} Xrm.TabSection.prototype={controls:null,getLabel:function(){return null;},getName:function(){return null;},getParent:function(){return null;},getVisible:function(){return false;},setLabel:function(label){},setVisible:function(visible){}} Type.registerNamespace('Xrm.ComponentModel');Xrm.ComponentModel.INotifyPropertyChanged=function(){};Xrm.ComponentModel.INotifyPropertyChanged.registerInterface('Xrm.ComponentModel.INotifyPropertyChanged');Type.registerNamespace('Xrm.Sdk');Xrm.Sdk.EntityStates=function(){};Xrm.Sdk.EntityStates.prototype = {unchanged:0,created:1,changed:2,deleted:3,readOnly:4} -Xrm.Sdk.EntityStates.registerEnum('Xrm.Sdk.EntityStates',false);Xrm.Sdk.Attribute=function(attributeName,typeName){this.attributeName=attributeName;this.typeName=typeName;this.formattedValue=null;this.value=null;this.id=null;this.logicalName=null;this.name=null;} +Xrm.Sdk.EntityStates.registerEnum('Xrm.Sdk.EntityStates',false);Xrm.Sdk.EntityRole=function(){};Xrm.Sdk.EntityRole.prototype = {referencing:0,referenced:1} +Xrm.Sdk.EntityRole.registerEnum('Xrm.Sdk.EntityRole',false);Xrm.Sdk.Attribute=function(attributeName,typeName){this.attributeName=attributeName;this.typeName=typeName;this.formattedValue=null;this.value=null;this.id=null;this.logicalName=null;this.name=null;} Xrm.Sdk.Attribute.deSerialise=function(node,overrideType){var $0=(Xrm.Sdk.XmlHelper.getAttributeValue(node,'i:nil')==='true');var $1=null;if(!$0){var $2=overrideType;if($2==null){$2=Xrm.Sdk.Attribute.$0(Xrm.Sdk.XmlHelper.getAttributeValue(node,'i:type'));}var $3=Xrm.Sdk.XmlHelper.getNodeTextValue(node);switch($2){case 'EntityReference':var $4=new Xrm.Sdk.EntityReference(new Xrm.Sdk.Guid(Xrm.Sdk.XmlHelper.selectSingleNodeValue(node,'Id')),Xrm.Sdk.XmlHelper.selectSingleNodeValue(node,'LogicalName'),Xrm.Sdk.XmlHelper.selectSingleNodeValue(node,'Name'));$1=$4;break;case 'AliasedValue':$1=Xrm.Sdk.Attribute.deSerialise(Xrm.Sdk.XmlHelper.selectSingleNode(node,'Value'),null);break;case 'boolean':$1=($3==='true');break;case 'decimal':$1=parseFloat($3);break;case 'dateTime':var $5=Xrm.Sdk.DateTimeEx.parse($3);var $6=Xrm.Sdk.OrganizationServiceProxy.userSettings;if($6!=null){$5.setTime($5.getTime()+($5.getTimezoneOffset()*60*1000));var $7=Xrm.Sdk.DateTimeEx.utcToLocalTimeFromSettings($5,$6);$1=$7;}else{$1=$5;}break;case 'guid':$1=new Xrm.Sdk.Guid($3);break;case 'int':$1=parseInt($3);break;case 'OptionSetValue':$1=Xrm.Sdk.OptionSetValue.parse(Xrm.Sdk.XmlHelper.selectSingleNodeValue(node,'Value'));break;case 'Money':$1=new Xrm.Sdk.Money(parseFloat(Xrm.Sdk.XmlHelper.selectSingleNodeValue(node,'Value')));break;case 'EntityCollection':$1=Xrm.Sdk.EntityCollection.deSerialise(node);break;default:$1=$3;break;}}return $1;} Xrm.Sdk.Attribute.serialise=function(attributeName,value,metaData){var $0=''+attributeName+'';var $1=Type.getInstanceType(value).get_name();if(value!=null&&metaData!=null&&Object.keyExists(metaData,attributeName)){$1=metaData[attributeName];}$0+=Xrm.Sdk.Attribute.serialiseValue(value,$1);$0+='';return $0;} Xrm.Sdk.Attribute.serialiseValue=function(value,overrideTypeName){var $0='';var $1=overrideTypeName;if($1==null){$1=Type.getInstanceType(value).get_name();}switch($1){case 'String':$0+='';$0+=Xrm.Sdk.XmlHelper.encode(value);$0+='';break;case 'Boolean':case 'bool':$0+='';$0+=Xrm.Sdk.XmlHelper.encode(value.toString());$0+='';break;case 'Date':var $2=value;var $3=null;var $4=Xrm.Sdk.OrganizationServiceProxy.userSettings;if($4!=null){var $D=Xrm.Sdk.DateTimeEx.localTimeToUTCFromSettings($2,$4);$3=Xrm.Sdk.DateTimeEx.toXrmString($D);}else{$3=Xrm.Sdk.DateTimeEx.toXrmStringUTC($2);}$0+='';$0+=Xrm.Sdk.XmlHelper.encode($3);$0+='';break;case 'decimal':$0+='';var $5=null;if(value!=null){$5=value.toString();}$0+=Xrm.Sdk.XmlHelper.encode($5);$0+='';break;case 'double':$0+='';var $6=null;if(value!=null){$6=value.toString();}$0+=Xrm.Sdk.XmlHelper.encode($6);$0+='';break;case 'int':$0+='';var $7=null;if(value!=null){$7=value.toString();}$0+=Xrm.Sdk.XmlHelper.encode($7);$0+='';break;case 'Guid':$0+='';$0+=(value).value;$0+='';break;case 'EntityReference':var $8=value;$0+='';$0+=''+$8.id+''+$8.logicalName+'';$0+='';break;case 'OptionSetValue':var $9=value;if($9.value!=null){$0+='';$0+=''+$9.value+'';$0+='';}else{$0+='';}break;case 'EntityCollection':$0+='';$0+=Xrm.Sdk.EntityCollection.serialise(value);$0+='';break;case 'Money':var $A=value;if($A!=null&&$A.value!=null){$0+='';$0+=''+$A.value.toString()+'';$0+='';}else{$0+='';}break;case 'EntityFilters':var $B=value;var $C=[];if((1&$B)===1){$C.add('Entity');}if((2&$B)===2){$C.add('Attributes');}if((4&$B)===4){$C.add('Privileges');}if((8&$B)===8){$C.add('Relationships');}$0+=''+Xrm.Sdk.XmlHelper.encode($C.join(' '))+'';break;default:$0+='';break;}return $0;} @@ -70,7 +71,7 @@ Xrm.Sdk.DateTimeEx.setUTCTime=function(date,time){if(date!=null&&time!=null){dat Xrm.Sdk.DateTimeEx.getTimeDuration=function(date){return (date.getHours()*(60*60))+(date.getMinutes()*60)+date.getSeconds();} Xrm.Sdk.Entity=function(entityName){this._metaData={};this.logicalName=entityName;this.$0={};this.formattedValues={};} Xrm.Sdk.Entity.sortDelegate=function(attributeName,a,b){var $0=a.getAttributeValue(attributeName);var $1=b.getAttributeValue(attributeName);var $2=0;var $3='';if($0!=null){$3=Type.getInstanceType($0).get_name();}else if($1!=null){$3=Type.getInstanceType($1).get_name();}if($0!==$1){switch($3.toLowerCase()){case 'string':$0=($0!=null)?($0).toLowerCase():null;$1=($1!=null)?($1).toLowerCase():null;if($0<$1){$2=-1;}else{$2=1;}break;case 'date':if($0<$1){$2=-1;}else{$2=1;}break;case 'number':var $4=($0!=null)?($0):0;var $5=($1!=null)?($1):0;$2=($4-$5);break;case 'money':var $6=($0!=null)?($0).value:0;var $7=($1!=null)?($1).value:0;$2=($6-$7);break;case 'optionsetvalue':var $8=($0!=null)?($0).value:0;$8=($8!=null)?$8:0;var $9=($1!=null)?($1).value:0;$9=($9!=null)?$9:0;$2=($8-$9);break;case 'entityreference':var $A=(($0!=null)&&(($0).name!=null))?($0).name:'';var $B=($1!=null&&(($1).name!=null))?($1).name:'';if($A<$B){$2=-1;}else{$2=1;}break;}}return $2;} -Xrm.Sdk.Entity.prototype={logicalName:null,id:null,entityState:0,$0:null,formattedValues:null,deSerialise:function(entityNode){this.logicalName=Xrm.Sdk.XmlHelper.selectSingleNodeValue(entityNode,'LogicalName');this.id=Xrm.Sdk.XmlHelper.selectSingleNodeValue(entityNode,'Id');var $0=Xrm.Sdk.XmlHelper.selectSingleNode(entityNode,'Attributes');var $1=$0.childNodes.length;for(var $3=0;$3<$1;$3++){var $4=$0.childNodes[$3];try{var $5=Xrm.Sdk.XmlHelper.selectSingleNodeValue($4,'key');var $6=Xrm.Sdk.Attribute.deSerialise(Xrm.Sdk.XmlHelper.selectSingleNode($4,'value'),null);this.$0[$5]=$6;this.$1($5,$6);}catch($7){throw new Error('Invalid Attribute Value :'+Xrm.Sdk.XmlHelper.getNodeTextValue($4)+':'+$7.message);}}var $2=Xrm.Sdk.XmlHelper.selectSingleNode(entityNode,'FormattedValues');if($2!=null){for(var $8=0;$8<$2.childNodes.length;$8++){var $9=$2.childNodes[$8];var $A=Xrm.Sdk.XmlHelper.selectSingleNodeValue($9,'key');var $B=Xrm.Sdk.XmlHelper.selectSingleNodeValue($9,'value');this.$1($A+'name',$B);this.formattedValues[$A+'name']=$B;var $C=this.$0[$A];if($C!=null){$C.name=$B;}}}},$1:function($p0,$p1){var $0=this;var $1=Type.safeCast($0,Object);$1[$p0]=$p1;},serialise:function(ommitRoot){var $0='';if(ommitRoot==null||!ommitRoot){$0+='';}$0+='';var $1=(this);if($1[this.logicalName+'id']==null){delete $1[this.logicalName+'id'];}var $enum1=ss.IEnumerator.getEnumerator(Object.keys($1));while($enum1.moveNext()){var $2=$enum1.current;if(typeof($1[$2])!="function"&&Object.prototype.hasOwnProperty.call(this, $2)&&!Xrm.StringEx.IN($2,['id','logicalName','entityState','formattedValues'])&&!$2.startsWith('$')&&!$2.startsWith('_')){var $3=$1[$2];if(!Object.keyExists(this.formattedValues,$2)){$0+=Xrm.Sdk.Attribute.serialise($2,$3,this._metaData);}}}$0+='';$0+=''+this.logicalName+'';if(this.id!=null){$0+=''+this.id+'';}if(ommitRoot==null||!ommitRoot){$0+='';}return $0;},setAttributeValue:function(name,value){this.$0[name]=value;this.$1(name,value);},getAttributeValue:function(attributeName){return this[attributeName];},getAttributeValueOptionSet:function(attributeName){return this.getAttributeValue(attributeName);},getAttributeValueGuid:function(attributeName){return this.getAttributeValue(attributeName);},getAttributeValueInt:function(attributeName){return this.getAttributeValue(attributeName);},getAttributeValueFloat:function(attributeName){return this.getAttributeValue(attributeName);},getAttributeValueString:function(attributeName){return this.getAttributeValue(attributeName);},getAttributeValueEntityReference:function(attributeName){return this.getAttributeValue(attributeName);},raisePropertyChanged:function(propertyName){var $0={};$0.propertyName=propertyName;if(this.$2!=null){this.$2(this,$0);}if(propertyName!=='EntityState'&&!this.entityState&&this.entityState!==1){this.entityState=2;}},toEntityReference:function(){return new Xrm.Sdk.EntityReference(new Xrm.Sdk.Guid(this.id),this.logicalName,'');},add_propertyChanged:function(value){this.$2=ss.Delegate.combine(this.$2,value);},remove_propertyChanged:function(value){this.$2=ss.Delegate.remove(this.$2,value);},$2:null} +Xrm.Sdk.Entity.prototype={logicalName:null,id:null,entityState:0,$0:null,formattedValues:null,relatedEntities:null,deSerialise:function(entityNode){this.logicalName=Xrm.Sdk.XmlHelper.selectSingleNodeValue(entityNode,'LogicalName');this.id=Xrm.Sdk.XmlHelper.selectSingleNodeValue(entityNode,'Id');var $0=Xrm.Sdk.XmlHelper.selectSingleNode(entityNode,'Attributes');var $1=$0.childNodes.length;for(var $4=0;$4<$1;$4++){var $5=$0.childNodes[$4];try{var $6=Xrm.Sdk.XmlHelper.selectSingleNodeValue($5,'key');var $7=Xrm.Sdk.Attribute.deSerialise(Xrm.Sdk.XmlHelper.selectSingleNode($5,'value'),null);this.$0[$6]=$7;this.$1($6,$7);}catch($8){throw new Error('Invalid Attribute Value :'+Xrm.Sdk.XmlHelper.getNodeTextValue($5)+':'+$8.message);}}var $2=Xrm.Sdk.XmlHelper.selectSingleNode(entityNode,'FormattedValues');if($2!=null){for(var $9=0;$9<$2.childNodes.length;$9++){var $A=$2.childNodes[$9];var $B=Xrm.Sdk.XmlHelper.selectSingleNodeValue($A,'key');var $C=Xrm.Sdk.XmlHelper.selectSingleNodeValue($A,'value');this.$1($B+'name',$C);this.formattedValues[$B+'name']=$C;var $D=this.$0[$B];if($D!=null){$D.name=$C;}}}var $3=Xrm.Sdk.XmlHelper.selectSingleNode(entityNode,'RelatedEntities');if($3!=null){var $E={};for(var $F=0;$F<$3.childNodes.length;$F++){var $10=$3.childNodes[$F];var $11=Xrm.Sdk.XmlHelper.selectSingleNode($10,'key');var $12=Xrm.Sdk.XmlHelper.selectSingleNodeValue($11,'SchemaName');var $13=new Xrm.Sdk.Relationship($12);var $14=Xrm.Sdk.XmlHelper.selectSingleNode($10,'value');var $15=Xrm.Sdk.EntityCollection.deSerialise($14);$E[$13.schemaName]=$15;}this.relatedEntities=$E;}},$1:function($p0,$p1){var $0=this;var $1=Type.safeCast($0,Object);$1[$p0]=$p1;},serialise:function(ommitRoot){var $0='';if(ommitRoot==null||!ommitRoot){$0+='';}$0+='';var $1=(this);if($1[this.logicalName+'id']==null){delete $1[this.logicalName+'id'];}var $enum1=ss.IEnumerator.getEnumerator(Object.keys($1));while($enum1.moveNext()){var $2=$enum1.current;if(typeof($1[$2])!="function"&&Object.prototype.hasOwnProperty.call(this, $2)&&!Xrm.StringEx.IN($2,['id','logicalName','entityState','formattedValues','relatedEntities'])&&!$2.startsWith('$')&&!$2.startsWith('_')){var $3=$1[$2];if(!Object.keyExists(this.formattedValues,$2)){$0+=Xrm.Sdk.Attribute.serialise($2,$3,this._metaData);}}}$0+='';$0+=''+this.logicalName+'';if(this.id!=null){$0+=''+this.id+'';}if(ommitRoot==null||!ommitRoot){$0+='';}return $0;},setAttributeValue:function(name,value){this.$0[name]=value;this.$1(name,value);},getAttributeValue:function(attributeName){return this[attributeName];},getAttributeValueOptionSet:function(attributeName){return this.getAttributeValue(attributeName);},getAttributeValueGuid:function(attributeName){return this.getAttributeValue(attributeName);},getAttributeValueInt:function(attributeName){return this.getAttributeValue(attributeName);},getAttributeValueFloat:function(attributeName){return this.getAttributeValue(attributeName);},getAttributeValueString:function(attributeName){return this.getAttributeValue(attributeName);},getAttributeValueEntityReference:function(attributeName){return this.getAttributeValue(attributeName);},raisePropertyChanged:function(propertyName){var $0={};$0.propertyName=propertyName;if(this.$2!=null){this.$2(this,$0);}if(propertyName!=='EntityState'&&!this.entityState&&this.entityState!==1){this.entityState=2;}},toEntityReference:function(){return new Xrm.Sdk.EntityReference(new Xrm.Sdk.Guid(this.id),this.logicalName,'');},add_propertyChanged:function(value){this.$2=ss.Delegate.combine(this.$2,value);},remove_propertyChanged:function(value){this.$2=ss.Delegate.remove(this.$2,value);},$2:null} Xrm.Sdk.EntityCollection=function(entities){this.$0=new Xrm.Sdk.DataCollectionOfEntity(entities);} Xrm.Sdk.EntityCollection.serialise=function(value){var $0='';if(Type.getInstanceType(value)!==Xrm.Sdk.EntityCollection){throw new Error("An attribute value of type 'EntityCollection' must contain an EntityCollection instance");}var $1=Type.safeCast(value,Xrm.Sdk.EntityCollection);$0+='';for(var $2=0;$2<$1.$0.get_count();$2++){$0+=($1.get_item($2)).serialise(false);}$0+='';return $0;} Xrm.Sdk.EntityCollection.deSerialise=function(node){var $0=[];var $1=new Xrm.Sdk.EntityCollection($0);$1.set_entityName(Xrm.Sdk.XmlHelper.selectSingleNodeValue(node,'EntityName'));var $2=Xrm.Sdk.XmlHelper.selectSingleNodeDeep(node,'Entities');var $enum1=ss.IEnumerator.getEnumerator($2.childNodes);while($enum1.moveNext()){var $3=$enum1.current;var $4=new Xrm.Sdk.Entity($1.get_entityName());$4.deSerialise($3);Xrm.ArrayEx.add($0,$4);}return $1;} @@ -123,22 +124,22 @@ Xrm.Sdk.OrganizationServiceProxy.endUpdate=function(asyncState){var $0=asyncStat Xrm.Sdk.OrganizationServiceProxy.execute=function(request){var $0=Xrm.Sdk.OrganizationServiceProxy.$B(Xrm.Sdk.OrganizationServiceProxy.$8(request),'Execute',null);return Xrm.Sdk.OrganizationServiceProxy.endExecute($0);} Xrm.Sdk.OrganizationServiceProxy.$8=function($p0){var $0='';$0+=$p0.serialise();$0+='';return $0;} Xrm.Sdk.OrganizationServiceProxy.beginExecute=function(request,callBack){Xrm.Sdk.OrganizationServiceProxy.$B(Xrm.Sdk.OrganizationServiceProxy.$8(request),'Execute',callBack);} -Xrm.Sdk.OrganizationServiceProxy.endExecute=function(asyncState){var $0=asyncState;if($0.childNodes!=null){var $1=Xrm.Sdk.XmlHelper.selectSingleNodeDeep($0,'ExecuteResult');var $2=Xrm.Sdk.XmlHelper.selectSingleNodeValue($1,'ResponseName');switch($2){case 'RetrieveAttribute':return new Xrm.Sdk.Messages.RetrieveAttributeResponse($1);case 'RetrieveAllEntities':return new Xrm.Sdk.Messages.RetrieveAllEntitiesResponse($1);case 'RetrieveEntity':return new Xrm.Sdk.Messages.RetrieveEntityResponse($1);case 'BulkDeleteResponse':return new Xrm.Sdk.Messages.BulkDeleteResponse($1);case 'FetchXmlToQueryExpression':return new Xrm.Sdk.Messages.FetchXmlToQueryExpressionResponse($1);case 'RetrieveMetadataChanges':return new Xrm.Sdk.Messages.RetrieveMetadataChangesResponse($1);case 'RetrieveRelationship':return new Xrm.Sdk.RetrieveRelationshipResponse($1);case 'ExecuteWorkflow':return new Xrm.Sdk.Messages.ExecuteWorkflowResponse($1);default:if(Object.keyExists(Xrm.Sdk.OrganizationServiceProxy.executeMessageResponseTypes,$2)){var $3=Xrm.Sdk.OrganizationServiceProxy.executeMessageResponseTypes[$2];var $4=new $3($1);return $4;}else{return null;}}}else{throw new Error(asyncState);}} +Xrm.Sdk.OrganizationServiceProxy.endExecute=function(asyncState){var $0=asyncState;if($0.childNodes!=null){var $1=Xrm.Sdk.XmlHelper.selectSingleNodeDeep($0,'ExecuteResult');var $2=Xrm.Sdk.XmlHelper.selectSingleNodeValue($1,'ResponseName');switch($2){case 'RetrieveAttribute':return new Xrm.Sdk.Messages.RetrieveAttributeResponse($1);case 'RetrieveAllEntities':return new Xrm.Sdk.Messages.RetrieveAllEntitiesResponse($1);case 'RetrieveEntity':return new Xrm.Sdk.Messages.RetrieveEntityResponse($1);case 'BulkDeleteResponse':return new Xrm.Sdk.Messages.BulkDeleteResponse($1);case 'FetchXmlToQueryExpression':return new Xrm.Sdk.Messages.FetchXmlToQueryExpressionResponse($1);case 'RetrieveMetadataChanges':return new Xrm.Sdk.Messages.RetrieveMetadataChangesResponse($1);case 'RetrieveRelationship':return new Xrm.Sdk.RetrieveRelationshipResponse($1);case 'ExecuteWorkflow':return new Xrm.Sdk.Messages.ExecuteWorkflowResponse($1);case 'Assign':return new Xrm.Sdk.Messages.AssignResponse($1);default:if(Object.keyExists(Xrm.Sdk.OrganizationServiceProxy.executeMessageResponseTypes,$2)){var $3=Xrm.Sdk.OrganizationServiceProxy.executeMessageResponseTypes[$2];var $4=new $3($1);return $4;}else{return null;}}}else{throw new Error(asyncState);}} Xrm.Sdk.OrganizationServiceProxy.$9=function($p0){var $0=''+''+$p0+''+'';return $0;} Xrm.Sdk.OrganizationServiceProxy.$A=function(){if(typeof(Xrm.Page.context.getClientUrl)==='undefined'){var $0=Xrm.Page.context;var $1;if($0.isOutlookClient()&&!$0.isOutlookOnline()){$1=window.location.protocol+'//'+window.location.hostname;}else{$1=Xrm.Page.context.getServerUrl();$1=$1.replace(new RegExp('/^(http|https):\\/\\/([_a-zA-Z0-9\\-\\.]+)(:([0-9]{1,5}))?/'),window.location.protocol+'//'+window.location.hostname);$1=$1.replace(new RegExp('/\\/$/'),'');}return $1;}else{return Xrm.Page.context.getClientUrl();}} Xrm.Sdk.OrganizationServiceProxy.$B=function($p0,$p1,$p2){var $0=($p2!=null);var $1=Xrm.Sdk.OrganizationServiceProxy.$9($p0);var $2=null;var $3=new XMLHttpRequest();$3.open('POST',Xrm.Sdk.OrganizationServiceProxy.$A()+'/XRMServices/2011/Organization.svc/web',$0);$3.setRequestHeader('SOAPAction','http://schemas.microsoft.com/xrm/2011/Contracts/Services/IOrganizationService/'+$p1);$3.setRequestHeader('Content-Type','text/xml; charset=utf-8');if(Xrm.Sdk.OrganizationServiceProxy.withCredentials){$3.withCredentials = true;;}if($0){$3.onreadystatechange=function(){ if($3==null){return;}if($3.readyState===4){var $1_0=$3.responseXML;var $1_1=null;if($3.status!==200){$1_1=Xrm.Sdk.OrganizationServiceProxy.$C($1_0);}delete $3;$3=null;if($1_1!=null){$p2($1_1);}else{$p2($1_0);}}};$3.send($1);return null;}else{$3.send($1);var $4=$3.responseXML;if($3.status!==200){$2=Xrm.Sdk.OrganizationServiceProxy.$C($4);}delete $3;;$3=null;if($2!=null){throw new Error("CRM SDK Call returned error: '"+$2+"'");}else{return $4;}}} Xrm.Sdk.OrganizationServiceProxy.$C=function($p0){var $0=null;if($p0==null||$p0.firstChild.nodeName!=='s:Envelope'){return 'No SOAP Envelope in response';}var $1=$p0.firstChild.firstChild;var $2=Xrm.Sdk.XmlHelper.selectSingleNode($1,'Fault');if($2!=null){var $3=Xrm.Sdk.XmlHelper.selectSingleNodeDeep($2,'Message');if($3!=null){$0=Xrm.Sdk.XmlHelper.getNodeTextValue($3);}else{var $4=Xrm.Sdk.XmlHelper.selectSingleNode($2,'faultstring');if($4!=null){$0=Xrm.Sdk.XmlHelper.getNodeTextValue($4);}}}return $0;} Xrm.Sdk.Relationship=function(schemaName){this.schemaName=schemaName;} -Xrm.Sdk.Relationship.prototype={schemaName:null} +Xrm.Sdk.Relationship.prototype={primaryEntityRole:0,schemaName:null} Xrm.Sdk.RetrieveRelationshipRequest=function(){this.metadataId=Xrm.Sdk.Guid.empty;} Xrm.Sdk.RetrieveRelationshipRequest.prototype={name:null,retrieveAsIfPublished:false,serialise:function(){return ''+''+''+'MetadataId'+Xrm.Sdk.Attribute.serialiseValue(this.metadataId,null)+''+''+'Name'+Xrm.Sdk.Attribute.serialiseValue(this.name,null)+''+''+'RetrieveAsIfPublished'+Xrm.Sdk.Attribute.serialiseValue(this.retrieveAsIfPublished,null)+''+''+''+'RetrieveRelationship'+'';}} Xrm.Sdk.RetrieveRelationshipResponse=function(response){var $0=Xrm.Sdk.XmlHelper.selectSingleNode(response,'Results');var $enum1=ss.IEnumerator.getEnumerator($0.childNodes);while($enum1.moveNext()){var $1=$enum1.current;var $2=Xrm.Sdk.XmlHelper.selectSingleNode($1,'key');if(Xrm.Sdk.XmlHelper.getNodeTextValue($2)==='RelationshipMetadata'){var $3=Xrm.Sdk.XmlHelper.selectSingleNode($1,'value');this.relationshipMetadata=Xrm.Sdk.Metadata.MetadataSerialiser.deSerialiseRelationshipMetadata($3);}}} Xrm.Sdk.RetrieveRelationshipResponse.prototype={relationshipMetadata:null} Xrm.Sdk.XmlHelper=function(){} -Xrm.Sdk.XmlHelper.encode=function(value){if(value==null){return value;}return value.replace(new RegExp('([\\&"<>])','g'),Xrm.Sdk.XmlHelper.replaceCallBackEncode);} +Xrm.Sdk.XmlHelper.encode=function(value){if(value==null){return value;}return value.replace(new RegExp("([\\&\"<>'])",'g'),Xrm.Sdk.XmlHelper.replaceCallBackEncode);} Xrm.Sdk.XmlHelper.serialiseNode=function(node){if(typeof(node.xml)==='undefined'){return new XMLSerializer().serializeToString(node);}else{return node.xml;}} -Xrm.Sdk.XmlHelper.Decode=function(value){if(value==null){return null;}return value.replace(new RegExp('("|<|>|&)','g'),Xrm.Sdk.XmlHelper.replaceCallBackDecode);} +Xrm.Sdk.XmlHelper.Decode=function(value){if(value==null){return null;}return value.replace(new RegExp('("|<|>|&|')','g'),Xrm.Sdk.XmlHelper.replaceCallBackDecode);} Xrm.Sdk.XmlHelper.replaceCallBackEncode=function(item){return Xrm.Sdk.XmlHelper._encode_map[item];} Xrm.Sdk.XmlHelper.replaceCallBackDecode=function(item){return Xrm.Sdk.XmlHelper._decode_map[item];} Xrm.Sdk.XmlHelper.selectSingleNodeValue=function(doc,baseName){var $0=Xrm.Sdk.XmlHelper.selectSingleNode(doc,baseName);if($0!=null){return Xrm.Sdk.XmlHelper.getNodeTextValue($0);}else{return null;}} @@ -153,7 +154,10 @@ Xrm.Sdk.XmlHelper.selectSingleNodeXpath=function(node,xpath){if(!Xrm.Sdk.XmlHelp Xrm.Sdk.XmlHelper.getNodeTextValue=function(node){if((node!=null)&&(node.firstChild!=null)){return node.firstChild.nodeValue;}else{return null;}} Xrm.Sdk.XmlHelper.getAttributeValue=function(node,attributeName){var $0=node.attributes.getNamedItem(attributeName);if($0!=null){return $0.nodeValue;}else{return null;}} Type.registerNamespace('Xrm.Sdk.Messages');Xrm.Sdk.Messages.EntityFilters=function(){};Xrm.Sdk.Messages.EntityFilters.prototype = {default_:1,entity:1,attributes:2,privileges:4,relationships:8,all:15} -Xrm.Sdk.Messages.EntityFilters.registerEnum('Xrm.Sdk.Messages.EntityFilters',true);Xrm.Sdk.Messages.BulkDeleteRequest=function(){} +Xrm.Sdk.Messages.EntityFilters.registerEnum('Xrm.Sdk.Messages.EntityFilters',true);Xrm.Sdk.Messages.AssignRequest=function(){} +Xrm.Sdk.Messages.AssignRequest.prototype={target:null,assignee:null,serialise:function(){return ''+' '+' '+' Target'+Xrm.Sdk.Attribute.serialiseValue(this.target,null)+' '+' '+' Assignee'+Xrm.Sdk.Attribute.serialiseValue(this.assignee,null)+' '+' '+' '+' Assign'+' ';}} +Xrm.Sdk.Messages.AssignResponse=function(response){} +Xrm.Sdk.Messages.BulkDeleteRequest=function(){} Xrm.Sdk.Messages.BulkDeleteRequest.prototype={serialise:function(){var $0='';if(this.toRecipients!=null){var $enum1=ss.IEnumerator.getEnumerator(this.toRecipients);while($enum1.moveNext()){var $2=$enum1.current;$0+=(''+$2.toString()+'');}}var $1='';if(this.ccRecipients!=null){var $enum2=ss.IEnumerator.getEnumerator(this.ccRecipients);while($enum2.moveNext()){var $3=$enum2.current;$1+=(''+$3.toString()+'');}}return String.format(''+' '+' '+' QuerySet'+' '+' '+this.querySet+' '+' '+' '+' '+' JobName'+' '+this.jobName+''+' '+' '+' SendEmailNotification'+' '+this.sendEmailNotification.toString()+''+' '+' '+' ToRecipients'+' '+$0+' '+' '+' '+' CCRecipients'+' '+$1+' '+' '+' '+' RecurrencePattern'+' '+this.recurrencePattern+''+' '+' '+' StartDateTime'+' '+Xrm.Sdk.DateTimeEx.toXrmStringUTC(Xrm.Sdk.DateTimeEx.localTimeToUTCFromSettings(this.startDateTime,Xrm.Sdk.OrganizationServiceProxy.getUserSettings()))+''+' '+' '+' '+' BulkDelete'+' ');},ccRecipients:null,jobName:null,querySet:null,recurrencePattern:null,sendEmailNotification:false,sourceImportId:null,startDateTime:null,toRecipients:null} Xrm.Sdk.Messages.BulkDeleteResponse=function(response){} Xrm.Sdk.Messages.ExecuteWorkflowRequest=function(){} @@ -197,12 +201,15 @@ Xrm.Sdk.Metadata.MetadataSerialiser.deSerialiseOptionMetadata=function(item,meta Xrm.Sdk.Metadata.MetadataSerialiser.deSerialiseOptionSetMetadata=function(item,metaData){var $0=Xrm.Sdk.XmlHelper.selectSingleNode(metaData,'Options');if($0!=null){item.options=[];var $enum1=ss.IEnumerator.getEnumerator($0.childNodes);while($enum1.moveNext()){var $1=$enum1.current;item.options.add(Xrm.Sdk.Metadata.MetadataSerialiser.deSerialiseOptionMetadata({},$1));}}return item;} Xrm.Sdk.Metadata.MetadataSerialiser.deSerialisePicklistAttributeMetadata=function(item,metaData){var $0=Xrm.Sdk.XmlHelper.selectSingleNode(metaData,'OptionSet');if($0!=null){item.optionSet=Xrm.Sdk.Metadata.MetadataSerialiser.deSerialiseOptionSetMetadata({},$0);}return item;} Xrm.Sdk.Metadata.MetadataCache=function(){} +Xrm.Sdk.Metadata.MetadataCache.get_entityMetaData=function(){return Xrm.Sdk.Metadata.MetadataCache.$1;} +Xrm.Sdk.Metadata.MetadataCache.get_attributeMetaData=function(){return Xrm.Sdk.Metadata.MetadataCache.$0;} +Xrm.Sdk.Metadata.MetadataCache.get_optionsetMetaData=function(){return Xrm.Sdk.Metadata.MetadataCache.$2;} Xrm.Sdk.Metadata.MetadataCache.getOptionSetValues=function(entityLogicalName,attributeLogicalName,allowEmpty){if(allowEmpty==null){allowEmpty=false;}var $0=entityLogicalName+'.'+attributeLogicalName+'.'+allowEmpty.toString();if(Object.keyExists(Xrm.Sdk.Metadata.MetadataCache.$2,$0)){return Xrm.Sdk.Metadata.MetadataCache.$2[$0];}else{var $1=Xrm.Sdk.Metadata.MetadataCache.$4(entityLogicalName,attributeLogicalName);var $2=$1;var $3=[];if(allowEmpty){$3.add({});}var $enum1=ss.IEnumerator.getEnumerator($2.optionSet.options);while($enum1.moveNext()){var $4=$enum1.current;var $5={};$5.name=$4.label.userLocalizedLabel.label;$5.value=$4.value;$3.add($5);}Xrm.Sdk.Metadata.MetadataCache.$2[$0]=$3;return $3;}} Xrm.Sdk.Metadata.MetadataCache.getEntityTypeCodeFromName=function(typeName){var $0=Xrm.Sdk.Metadata.MetadataCache.$3(typeName);return $0.objectTypeCode;} Xrm.Sdk.Metadata.MetadataCache.getSmallIconUrl=function(typeName){var $0=Xrm.Sdk.Metadata.MetadataCache.$3(typeName);if($0.isCustomEntity!=null&&!!$0.isCustomEntity){if($0.iconSmallName!=null){return '../../'+$0.iconSmallName;}else{return '../../../../_Common/icon.aspx?cache=1&iconType=NavigationIcon&objectTypeCode='+$0.objectTypeCode.toString();}}else{return '/_imgs/ico_16_'+$0.objectTypeCode.toString()+'.gif';}} Xrm.Sdk.Metadata.MetadataCache.$3=function($p0){var $0=$p0;var $1=Xrm.Sdk.Metadata.MetadataCache.$1[$0];if($1==null){var $2=new Xrm.Sdk.Messages.RetrieveEntityRequest();$2.entityFilters=1;$2.logicalName=$p0;$2.retrieveAsIfPublished=true;$2.metadataId=new Xrm.Sdk.Guid('00000000-0000-0000-0000-000000000000');var $3=Xrm.Sdk.OrganizationServiceProxy.execute($2);$1=$3.entityMetadata;Xrm.Sdk.Metadata.MetadataCache.$1[$0]=$1;}return $1;} Xrm.Sdk.Metadata.MetadataCache.$4=function($p0,$p1){var $0=$p0+'|'+$p1;var $1=Xrm.Sdk.Metadata.MetadataCache.$0[$0];if($1==null){var $2=new Xrm.Sdk.Messages.RetrieveAttributeRequest();$2.entityLogicalName=$p0;$2.logicalName=$p1;$2.retrieveAsIfPublished=true;var $3=Xrm.Sdk.OrganizationServiceProxy.execute($2);$1=$3.attributeMetadata;Xrm.Sdk.Metadata.MetadataCache.$0[$0]=$1;}return $1;} -Xrm.Sdk.Metadata.MetadataCache.prototype={get_entityMetaData:function(){return Xrm.Sdk.Metadata.MetadataCache.$1;},get_attributeMetaData:function(){return Xrm.Sdk.Metadata.MetadataCache.$0;},get_optionsetMetaData:function(){return Xrm.Sdk.Metadata.MetadataCache.$2;}} +Xrm.Sdk.Metadata.MetadataCache.AddOptionsetMetadata=function(entityLogicalName,attributeLogicalName,allowEmpty,metatdata){var $0=entityLogicalName+'.'+attributeLogicalName+'.'+allowEmpty.toString();var $1=[];if(allowEmpty){$1.add({});}var $enum1=ss.IEnumerator.getEnumerator(metatdata);while($enum1.moveNext()){var $2=$enum1.current;var $3={};$3.name=$2['label'];$3.value=$2['value'];$1.add($3);}Xrm.Sdk.Metadata.MetadataCache.get_optionsetMetaData()[$0]=$1;} Type.registerNamespace('Xrm.Sdk.Metadata.Query');Xrm.Sdk.Metadata.Query.DeletedMetadataFilters=function(){};Xrm.Sdk.Metadata.Query.DeletedMetadataFilters.prototype = {default_:'default_',entity:'entity',attribute:'attribute',relationship:'relationship',label:'label',optionSet:'optionSet',all:'all'} Xrm.Sdk.Metadata.Query.DeletedMetadataFilters.registerEnum('Xrm.Sdk.Metadata.Query.DeletedMetadataFilters',false);Xrm.Sdk.Metadata.Query.MetadataConditionOperator=function(){};Xrm.Sdk.Metadata.Query.MetadataConditionOperator.prototype = {Equals:'Equals',NotEquals:'NotEquals',In:'In',NotIn:'NotIn',GreaterThan:'GreaterThan',LessThan:'LessThan'} Xrm.Sdk.Metadata.Query.MetadataConditionOperator.registerEnum('Xrm.Sdk.Metadata.Query.MetadataConditionOperator',false);Xrm.Sdk.Metadata.Query.LogicalOperator=function(){};Xrm.Sdk.Metadata.Query.LogicalOperator.prototype = {And:'And',Or:'Or'} @@ -231,5 +238,5 @@ Xrm.Services.CachedOrganizationService.retrieve=function(entityName,entityId,att Xrm.Services.CachedOrganizationService.retrieveMultiple=function(fetchXml){var $0=Xrm.Services.CachedOrganizationService.cache.get('query',fetchXml);if($0==null){$0=Xrm.Sdk.OrganizationServiceProxy.retrieveMultiple(fetchXml);Xrm.Services.CachedOrganizationService.cache.insert('query',fetchXml,$0);return $0;}else{return $0;}} Xrm.Services.OrganizationServiceCache=function(){this.$0={};} Xrm.Services.OrganizationServiceCache.prototype={remove:function(entityName,id){},insert:function(key,query,results){this.$0[key+'_'+query]=results;},get:function(key,query){return this.$0[key+'_'+query];}} -Xrm.ArrayEx.registerClass('Xrm.ArrayEx');Xrm.DelegateItterator.registerClass('Xrm.DelegateItterator');Xrm.NumberEx.registerClass('Xrm.NumberEx');Xrm.PageEx.registerClass('Xrm.PageEx');Xrm.StringEx.registerClass('Xrm.StringEx');Xrm.TaskIterrator.registerClass('Xrm.TaskIterrator');Xrm.TabItem.registerClass('Xrm.TabItem');Xrm.TabSection.registerClass('Xrm.TabSection');Xrm.Sdk.Attribute.registerClass('Xrm.Sdk.Attribute');Xrm.Sdk.AttributeTypes.registerClass('Xrm.Sdk.AttributeTypes');Xrm.Sdk.Entity.registerClass('Xrm.Sdk.Entity',null,Xrm.ComponentModel.INotifyPropertyChanged);Xrm.Sdk.OrganizationSettings.registerClass('Xrm.Sdk.OrganizationSettings',Xrm.Sdk.Entity);Xrm.Sdk.UserSettingsAttributes.registerClass('Xrm.Sdk.UserSettingsAttributes');Xrm.Sdk.UserSettings.registerClass('Xrm.Sdk.UserSettings',Xrm.Sdk.Entity);Xrm.Sdk.DataCollectionOfEntity.registerClass('Xrm.Sdk.DataCollectionOfEntity',null,ss.IEnumerable);Xrm.Sdk.DateTimeEx.registerClass('Xrm.Sdk.DateTimeEx');Xrm.Sdk.EntityCollection.registerClass('Xrm.Sdk.EntityCollection');Xrm.Sdk.EntityReference.registerClass('Xrm.Sdk.EntityReference');Xrm.Sdk.Guid.registerClass('Xrm.Sdk.Guid');Xrm.Sdk.Money.registerClass('Xrm.Sdk.Money');Xrm.Sdk.OptionSetValue.registerClass('Xrm.Sdk.OptionSetValue');Xrm.Sdk.OrganizationServiceProxy.registerClass('Xrm.Sdk.OrganizationServiceProxy');Xrm.Sdk.Relationship.registerClass('Xrm.Sdk.Relationship');Xrm.Sdk.RetrieveRelationshipRequest.registerClass('Xrm.Sdk.RetrieveRelationshipRequest',null,Object);Xrm.Sdk.RetrieveRelationshipResponse.registerClass('Xrm.Sdk.RetrieveRelationshipResponse',null,Object);Xrm.Sdk.XmlHelper.registerClass('Xrm.Sdk.XmlHelper');Xrm.Sdk.Messages.BulkDeleteRequest.registerClass('Xrm.Sdk.Messages.BulkDeleteRequest',null,Object);Xrm.Sdk.Messages.BulkDeleteResponse.registerClass('Xrm.Sdk.Messages.BulkDeleteResponse',null,Object);Xrm.Sdk.Messages.ExecuteWorkflowRequest.registerClass('Xrm.Sdk.Messages.ExecuteWorkflowRequest',null,Object);Xrm.Sdk.Messages.ExecuteWorkflowResponse.registerClass('Xrm.Sdk.Messages.ExecuteWorkflowResponse',null,Object);Xrm.Sdk.Messages.FetchXmlToQueryExpressionRequest.registerClass('Xrm.Sdk.Messages.FetchXmlToQueryExpressionRequest',null,Object);Xrm.Sdk.Messages.FetchXmlToQueryExpressionResponse.registerClass('Xrm.Sdk.Messages.FetchXmlToQueryExpressionResponse',null,Object);Xrm.Sdk.Messages.RetrieveAllEntitiesRequest.registerClass('Xrm.Sdk.Messages.RetrieveAllEntitiesRequest',null,Object);Xrm.Sdk.Messages.RetrieveAllEntitiesResponse.registerClass('Xrm.Sdk.Messages.RetrieveAllEntitiesResponse',null,Object);Xrm.Sdk.Messages.RetrieveAttributeRequest.registerClass('Xrm.Sdk.Messages.RetrieveAttributeRequest',null,Object);Xrm.Sdk.Messages.RetrieveAttributeResponse.registerClass('Xrm.Sdk.Messages.RetrieveAttributeResponse',null,Object);Xrm.Sdk.Messages.RetrieveEntityRequest.registerClass('Xrm.Sdk.Messages.RetrieveEntityRequest',null,Object);Xrm.Sdk.Messages.RetrieveEntityResponse.registerClass('Xrm.Sdk.Messages.RetrieveEntityResponse',null,Object);Xrm.Sdk.Messages.RetrieveMetadataChangesRequest.registerClass('Xrm.Sdk.Messages.RetrieveMetadataChangesRequest',null,Object);Xrm.Sdk.Messages.RetrieveMetadataChangesResponse.registerClass('Xrm.Sdk.Messages.RetrieveMetadataChangesResponse',null,Object);Xrm.Sdk.Metadata.MetadataSerialiser.registerClass('Xrm.Sdk.Metadata.MetadataSerialiser');Xrm.Sdk.Metadata.MetadataCache.registerClass('Xrm.Sdk.Metadata.MetadataCache');Xrm.Sdk.Metadata.Query.MetadataSerialiser.registerClass('Xrm.Sdk.Metadata.Query.MetadataSerialiser');Xrm.Sdk.Metadata.Query.MetadataQueryBuilder.registerClass('Xrm.Sdk.Metadata.Query.MetadataQueryBuilder');Xrm.Sdk.Ribbon.RibbonControl.registerClass('Xrm.Sdk.Ribbon.RibbonControl');Xrm.Sdk.Ribbon.RibbonButton.registerClass('Xrm.Sdk.Ribbon.RibbonButton',Xrm.Sdk.Ribbon.RibbonControl);Xrm.Sdk.Ribbon.RibbonFlyoutAnchor.registerClass('Xrm.Sdk.Ribbon.RibbonFlyoutAnchor',Xrm.Sdk.Ribbon.RibbonControl);Xrm.Sdk.Ribbon.RibbonMenu.registerClass('Xrm.Sdk.Ribbon.RibbonMenu');Xrm.Sdk.Ribbon.RibbonMenuSection.registerClass('Xrm.Sdk.Ribbon.RibbonMenuSection');Xrm.Services.CachedOrganizationService.registerClass('Xrm.Services.CachedOrganizationService');Xrm.Services.OrganizationServiceCache.registerClass('Xrm.Services.OrganizationServiceCache');Xrm.PageEx.majorVersion=0;(function(){Xrm.PageEx.majorVersion=2011;if(typeof(window.APPLICATION_VERSION)!=='undefined'){var $0=window.APPLICATION_VERSION;if($0!=='5.0'){Xrm.PageEx.majorVersion=2013;}}})(); -Xrm.Sdk.AttributeTypes.string_='string';Xrm.Sdk.AttributeTypes.decimal_='decimal';Xrm.Sdk.AttributeTypes.int_='int';Xrm.Sdk.AttributeTypes.double_='double';Xrm.Sdk.AttributeTypes.dateTime_='dateTime';Xrm.Sdk.AttributeTypes.boolean_='boolean';Xrm.Sdk.AttributeTypes.entityReference='EntityReference';Xrm.Sdk.AttributeTypes.guid_='guid';Xrm.Sdk.AttributeTypes.optionSetValue='OptionSetValue';Xrm.Sdk.AttributeTypes.aliasedValue='AliasedValue';Xrm.Sdk.AttributeTypes.entityCollection='EntityCollection';Xrm.Sdk.AttributeTypes.money='Money';Xrm.Sdk.OrganizationSettings.entityLogicalName='organization';Xrm.Sdk.UserSettingsAttributes.userSettingsId='usersettingsid';Xrm.Sdk.UserSettingsAttributes.businessUnitId='businessunitid';Xrm.Sdk.UserSettingsAttributes.calendarType='calendartype';Xrm.Sdk.UserSettingsAttributes.currencyDecimalPrecision='currencydecimalprecision';Xrm.Sdk.UserSettingsAttributes.currencyFormatCode='currencyformatcode';Xrm.Sdk.UserSettingsAttributes.currencySymbol='currencysymbol';Xrm.Sdk.UserSettingsAttributes.dateFormatCode='dateformatcode';Xrm.Sdk.UserSettingsAttributes.dateFormatString='dateformatstring';Xrm.Sdk.UserSettingsAttributes.dateSeparator='dateseparator';Xrm.Sdk.UserSettingsAttributes.decimalSymbol='decimalsymbol';Xrm.Sdk.UserSettingsAttributes.defaultCalendarView='defaultcalendarview';Xrm.Sdk.UserSettingsAttributes.defaultDashboardId='defaultdashboardid';Xrm.Sdk.UserSettingsAttributes.localeId='localeid';Xrm.Sdk.UserSettingsAttributes.longDateFormatCode='longdateformatcode';Xrm.Sdk.UserSettingsAttributes.negativeCurrencyFormatCode='negativecurrencyformatcode';Xrm.Sdk.UserSettingsAttributes.negativeFormatCode='negativeformatcode';Xrm.Sdk.UserSettingsAttributes.numberGroupFormat='numbergroupformat';Xrm.Sdk.UserSettingsAttributes.numberSeparator='numberseparator';Xrm.Sdk.UserSettingsAttributes.offlineSyncInterval='offlinesyncinterval';Xrm.Sdk.UserSettingsAttributes.pricingDecimalPrecision='pricingdecimalprecision';Xrm.Sdk.UserSettingsAttributes.showWeekNumber='showweeknumber';Xrm.Sdk.UserSettingsAttributes.systemUserId='systemuserid';Xrm.Sdk.UserSettingsAttributes.timeFormatCodestring='timeformatcodestring';Xrm.Sdk.UserSettingsAttributes.timeFormatString='timeformatstring';Xrm.Sdk.UserSettingsAttributes.timeSeparator='timeseparator';Xrm.Sdk.UserSettingsAttributes.timeZoneBias='timezonebias';Xrm.Sdk.UserSettingsAttributes.timeZoneCode='timezonecode';Xrm.Sdk.UserSettingsAttributes.timeZoneDaylightBias='timezonedaylightbias';Xrm.Sdk.UserSettingsAttributes.timeZoneDaylightDay='timezonedaylightday';Xrm.Sdk.UserSettingsAttributes.timeZoneDaylightDayOfWeek='timezonedaylightdayofweek';Xrm.Sdk.UserSettingsAttributes.timeZoneDaylightHour='timezonedaylighthour';Xrm.Sdk.UserSettingsAttributes.timeZoneDaylightMinute='timezonedaylightminute';Xrm.Sdk.UserSettingsAttributes.timeZoneDaylightMonth='timezonedaylightmonth';Xrm.Sdk.UserSettingsAttributes.timeZoneDaylightSecond='timezonedaylightsecond';Xrm.Sdk.UserSettingsAttributes.timeZoneDaylightYear='timezonedaylightyear';Xrm.Sdk.UserSettingsAttributes.timeZoneStandardBias='timezonestandardbias';Xrm.Sdk.UserSettingsAttributes.timeZoneStandardDay='timezonestandardday';Xrm.Sdk.UserSettingsAttributes.timeZoneStandardDayOfWeek='timezonestandarddayofweek';Xrm.Sdk.UserSettingsAttributes.timeZoneStandardHour='timezonestandardhour';Xrm.Sdk.UserSettingsAttributes.timeZoneStandardMinute='timezonestandardminute';Xrm.Sdk.UserSettingsAttributes.timeZoneStandardMonth='timezonestandardmonth';Xrm.Sdk.UserSettingsAttributes.timeZoneStandardSecond='timezonestandardsecond';Xrm.Sdk.UserSettingsAttributes.timeZoneStandardYear='timezonestandardyear';Xrm.Sdk.UserSettingsAttributes.transactionCurrencyId='transactioncurrencyid';Xrm.Sdk.UserSettingsAttributes.uiLanguageId='uilanguageid';Xrm.Sdk.UserSettingsAttributes.workdayStartTime='workdaystarttime';Xrm.Sdk.UserSettingsAttributes.workdayStopTime='workdaystoptime';Xrm.Sdk.UserSettings.entityLogicalName='usersettings';Xrm.Sdk.Guid.empty=new Xrm.Sdk.Guid('00000000-0000-0000-0000-000000000000');Xrm.Sdk.OrganizationServiceProxy.withCredentials=false;Xrm.Sdk.OrganizationServiceProxy.userSettings=null;Xrm.Sdk.OrganizationServiceProxy.executeMessageResponseTypes={};Xrm.Sdk.OrganizationServiceProxy.organizationSettings=null;Xrm.Sdk.XmlHelper._encode_map={'&':'&','"':'"','<':'<','>':'>'};Xrm.Sdk.XmlHelper._decode_map={'&':'&','"':'"','<':'<','>':'>'};Xrm.Sdk.Metadata.MetadataCache.$0={};Xrm.Sdk.Metadata.MetadataCache.$1={};Xrm.Sdk.Metadata.MetadataCache.$2={};Xrm.Services.CachedOrganizationService.cache=new Xrm.Services.OrganizationServiceCache();}); \ No newline at end of file +Xrm.ArrayEx.registerClass('Xrm.ArrayEx');Xrm.DelegateItterator.registerClass('Xrm.DelegateItterator');Xrm.NumberEx.registerClass('Xrm.NumberEx');Xrm.PageEx.registerClass('Xrm.PageEx');Xrm.StringEx.registerClass('Xrm.StringEx');Xrm.TaskIterrator.registerClass('Xrm.TaskIterrator');Xrm.TabItem.registerClass('Xrm.TabItem');Xrm.TabSection.registerClass('Xrm.TabSection');Xrm.Sdk.Attribute.registerClass('Xrm.Sdk.Attribute');Xrm.Sdk.AttributeTypes.registerClass('Xrm.Sdk.AttributeTypes');Xrm.Sdk.Entity.registerClass('Xrm.Sdk.Entity',null,Xrm.ComponentModel.INotifyPropertyChanged);Xrm.Sdk.OrganizationSettings.registerClass('Xrm.Sdk.OrganizationSettings',Xrm.Sdk.Entity);Xrm.Sdk.UserSettingsAttributes.registerClass('Xrm.Sdk.UserSettingsAttributes');Xrm.Sdk.UserSettings.registerClass('Xrm.Sdk.UserSettings',Xrm.Sdk.Entity);Xrm.Sdk.DataCollectionOfEntity.registerClass('Xrm.Sdk.DataCollectionOfEntity',null,ss.IEnumerable);Xrm.Sdk.DateTimeEx.registerClass('Xrm.Sdk.DateTimeEx');Xrm.Sdk.EntityCollection.registerClass('Xrm.Sdk.EntityCollection');Xrm.Sdk.EntityReference.registerClass('Xrm.Sdk.EntityReference');Xrm.Sdk.Guid.registerClass('Xrm.Sdk.Guid');Xrm.Sdk.Money.registerClass('Xrm.Sdk.Money');Xrm.Sdk.OptionSetValue.registerClass('Xrm.Sdk.OptionSetValue');Xrm.Sdk.OrganizationServiceProxy.registerClass('Xrm.Sdk.OrganizationServiceProxy');Xrm.Sdk.Relationship.registerClass('Xrm.Sdk.Relationship');Xrm.Sdk.RetrieveRelationshipRequest.registerClass('Xrm.Sdk.RetrieveRelationshipRequest',null,Object);Xrm.Sdk.RetrieveRelationshipResponse.registerClass('Xrm.Sdk.RetrieveRelationshipResponse',null,Object);Xrm.Sdk.XmlHelper.registerClass('Xrm.Sdk.XmlHelper');Xrm.Sdk.Messages.AssignRequest.registerClass('Xrm.Sdk.Messages.AssignRequest',null,Object);Xrm.Sdk.Messages.AssignResponse.registerClass('Xrm.Sdk.Messages.AssignResponse',null,Object);Xrm.Sdk.Messages.BulkDeleteRequest.registerClass('Xrm.Sdk.Messages.BulkDeleteRequest',null,Object);Xrm.Sdk.Messages.BulkDeleteResponse.registerClass('Xrm.Sdk.Messages.BulkDeleteResponse',null,Object);Xrm.Sdk.Messages.ExecuteWorkflowRequest.registerClass('Xrm.Sdk.Messages.ExecuteWorkflowRequest',null,Object);Xrm.Sdk.Messages.ExecuteWorkflowResponse.registerClass('Xrm.Sdk.Messages.ExecuteWorkflowResponse',null,Object);Xrm.Sdk.Messages.FetchXmlToQueryExpressionRequest.registerClass('Xrm.Sdk.Messages.FetchXmlToQueryExpressionRequest',null,Object);Xrm.Sdk.Messages.FetchXmlToQueryExpressionResponse.registerClass('Xrm.Sdk.Messages.FetchXmlToQueryExpressionResponse',null,Object);Xrm.Sdk.Messages.RetrieveAllEntitiesRequest.registerClass('Xrm.Sdk.Messages.RetrieveAllEntitiesRequest',null,Object);Xrm.Sdk.Messages.RetrieveAllEntitiesResponse.registerClass('Xrm.Sdk.Messages.RetrieveAllEntitiesResponse',null,Object);Xrm.Sdk.Messages.RetrieveAttributeRequest.registerClass('Xrm.Sdk.Messages.RetrieveAttributeRequest',null,Object);Xrm.Sdk.Messages.RetrieveAttributeResponse.registerClass('Xrm.Sdk.Messages.RetrieveAttributeResponse',null,Object);Xrm.Sdk.Messages.RetrieveEntityRequest.registerClass('Xrm.Sdk.Messages.RetrieveEntityRequest',null,Object);Xrm.Sdk.Messages.RetrieveEntityResponse.registerClass('Xrm.Sdk.Messages.RetrieveEntityResponse',null,Object);Xrm.Sdk.Messages.RetrieveMetadataChangesRequest.registerClass('Xrm.Sdk.Messages.RetrieveMetadataChangesRequest',null,Object);Xrm.Sdk.Messages.RetrieveMetadataChangesResponse.registerClass('Xrm.Sdk.Messages.RetrieveMetadataChangesResponse',null,Object);Xrm.Sdk.Metadata.MetadataSerialiser.registerClass('Xrm.Sdk.Metadata.MetadataSerialiser');Xrm.Sdk.Metadata.MetadataCache.registerClass('Xrm.Sdk.Metadata.MetadataCache');Xrm.Sdk.Metadata.Query.MetadataSerialiser.registerClass('Xrm.Sdk.Metadata.Query.MetadataSerialiser');Xrm.Sdk.Metadata.Query.MetadataQueryBuilder.registerClass('Xrm.Sdk.Metadata.Query.MetadataQueryBuilder');Xrm.Sdk.Ribbon.RibbonControl.registerClass('Xrm.Sdk.Ribbon.RibbonControl');Xrm.Sdk.Ribbon.RibbonButton.registerClass('Xrm.Sdk.Ribbon.RibbonButton',Xrm.Sdk.Ribbon.RibbonControl);Xrm.Sdk.Ribbon.RibbonFlyoutAnchor.registerClass('Xrm.Sdk.Ribbon.RibbonFlyoutAnchor',Xrm.Sdk.Ribbon.RibbonControl);Xrm.Sdk.Ribbon.RibbonMenu.registerClass('Xrm.Sdk.Ribbon.RibbonMenu');Xrm.Sdk.Ribbon.RibbonMenuSection.registerClass('Xrm.Sdk.Ribbon.RibbonMenuSection');Xrm.Services.CachedOrganizationService.registerClass('Xrm.Services.CachedOrganizationService');Xrm.Services.OrganizationServiceCache.registerClass('Xrm.Services.OrganizationServiceCache');Xrm.PageEx.majorVersion=0;(function(){Xrm.PageEx.majorVersion=2011;if(typeof(window.APPLICATION_VERSION)!=='undefined'){var $0=window.APPLICATION_VERSION;if($0!=='5.0'){Xrm.PageEx.majorVersion=2013;}}})(); +Xrm.Sdk.AttributeTypes.string_='string';Xrm.Sdk.AttributeTypes.decimal_='decimal';Xrm.Sdk.AttributeTypes.int_='int';Xrm.Sdk.AttributeTypes.double_='double';Xrm.Sdk.AttributeTypes.dateTime_='dateTime';Xrm.Sdk.AttributeTypes.boolean_='boolean';Xrm.Sdk.AttributeTypes.entityReference='EntityReference';Xrm.Sdk.AttributeTypes.guid_='guid';Xrm.Sdk.AttributeTypes.optionSetValue='OptionSetValue';Xrm.Sdk.AttributeTypes.aliasedValue='AliasedValue';Xrm.Sdk.AttributeTypes.entityCollection='EntityCollection';Xrm.Sdk.AttributeTypes.money='Money';Xrm.Sdk.OrganizationSettings.entityLogicalName='organization';Xrm.Sdk.UserSettingsAttributes.userSettingsId='usersettingsid';Xrm.Sdk.UserSettingsAttributes.businessUnitId='businessunitid';Xrm.Sdk.UserSettingsAttributes.calendarType='calendartype';Xrm.Sdk.UserSettingsAttributes.currencyDecimalPrecision='currencydecimalprecision';Xrm.Sdk.UserSettingsAttributes.currencyFormatCode='currencyformatcode';Xrm.Sdk.UserSettingsAttributes.currencySymbol='currencysymbol';Xrm.Sdk.UserSettingsAttributes.dateFormatCode='dateformatcode';Xrm.Sdk.UserSettingsAttributes.dateFormatString='dateformatstring';Xrm.Sdk.UserSettingsAttributes.dateSeparator='dateseparator';Xrm.Sdk.UserSettingsAttributes.decimalSymbol='decimalsymbol';Xrm.Sdk.UserSettingsAttributes.defaultCalendarView='defaultcalendarview';Xrm.Sdk.UserSettingsAttributes.defaultDashboardId='defaultdashboardid';Xrm.Sdk.UserSettingsAttributes.localeId='localeid';Xrm.Sdk.UserSettingsAttributes.longDateFormatCode='longdateformatcode';Xrm.Sdk.UserSettingsAttributes.negativeCurrencyFormatCode='negativecurrencyformatcode';Xrm.Sdk.UserSettingsAttributes.negativeFormatCode='negativeformatcode';Xrm.Sdk.UserSettingsAttributes.numberGroupFormat='numbergroupformat';Xrm.Sdk.UserSettingsAttributes.numberSeparator='numberseparator';Xrm.Sdk.UserSettingsAttributes.offlineSyncInterval='offlinesyncinterval';Xrm.Sdk.UserSettingsAttributes.pricingDecimalPrecision='pricingdecimalprecision';Xrm.Sdk.UserSettingsAttributes.showWeekNumber='showweeknumber';Xrm.Sdk.UserSettingsAttributes.systemUserId='systemuserid';Xrm.Sdk.UserSettingsAttributes.timeFormatCodestring='timeformatcodestring';Xrm.Sdk.UserSettingsAttributes.timeFormatString='timeformatstring';Xrm.Sdk.UserSettingsAttributes.timeSeparator='timeseparator';Xrm.Sdk.UserSettingsAttributes.timeZoneBias='timezonebias';Xrm.Sdk.UserSettingsAttributes.timeZoneCode='timezonecode';Xrm.Sdk.UserSettingsAttributes.timeZoneDaylightBias='timezonedaylightbias';Xrm.Sdk.UserSettingsAttributes.timeZoneDaylightDay='timezonedaylightday';Xrm.Sdk.UserSettingsAttributes.timeZoneDaylightDayOfWeek='timezonedaylightdayofweek';Xrm.Sdk.UserSettingsAttributes.timeZoneDaylightHour='timezonedaylighthour';Xrm.Sdk.UserSettingsAttributes.timeZoneDaylightMinute='timezonedaylightminute';Xrm.Sdk.UserSettingsAttributes.timeZoneDaylightMonth='timezonedaylightmonth';Xrm.Sdk.UserSettingsAttributes.timeZoneDaylightSecond='timezonedaylightsecond';Xrm.Sdk.UserSettingsAttributes.timeZoneDaylightYear='timezonedaylightyear';Xrm.Sdk.UserSettingsAttributes.timeZoneStandardBias='timezonestandardbias';Xrm.Sdk.UserSettingsAttributes.timeZoneStandardDay='timezonestandardday';Xrm.Sdk.UserSettingsAttributes.timeZoneStandardDayOfWeek='timezonestandarddayofweek';Xrm.Sdk.UserSettingsAttributes.timeZoneStandardHour='timezonestandardhour';Xrm.Sdk.UserSettingsAttributes.timeZoneStandardMinute='timezonestandardminute';Xrm.Sdk.UserSettingsAttributes.timeZoneStandardMonth='timezonestandardmonth';Xrm.Sdk.UserSettingsAttributes.timeZoneStandardSecond='timezonestandardsecond';Xrm.Sdk.UserSettingsAttributes.timeZoneStandardYear='timezonestandardyear';Xrm.Sdk.UserSettingsAttributes.transactionCurrencyId='transactioncurrencyid';Xrm.Sdk.UserSettingsAttributes.uiLanguageId='uilanguageid';Xrm.Sdk.UserSettingsAttributes.workdayStartTime='workdaystarttime';Xrm.Sdk.UserSettingsAttributes.workdayStopTime='workdaystoptime';Xrm.Sdk.UserSettings.entityLogicalName='usersettings';Xrm.Sdk.Guid.empty=new Xrm.Sdk.Guid('00000000-0000-0000-0000-000000000000');Xrm.Sdk.OrganizationServiceProxy.withCredentials=false;Xrm.Sdk.OrganizationServiceProxy.userSettings=null;Xrm.Sdk.OrganizationServiceProxy.executeMessageResponseTypes={};Xrm.Sdk.OrganizationServiceProxy.organizationSettings=null;Xrm.Sdk.XmlHelper._encode_map={'&':'&','"':'"','<':'<','>':'>',"'":'''};Xrm.Sdk.XmlHelper._decode_map={'&':'&','"':'"','<':'<','>':'>',''':"'"};Xrm.Sdk.Metadata.MetadataCache.$0={};Xrm.Sdk.Metadata.MetadataCache.$1={};Xrm.Sdk.Metadata.MetadataCache.$2={};Xrm.Services.CachedOrganizationService.cache=new Xrm.Services.OrganizationServiceCache();}); \ No newline at end of file diff --git a/SparkleXrmSource/SparkleXrmUI/GridEditor/CrmPagerControl.cs b/SparkleXrmSource/SparkleXrmUI/GridEditor/CrmPagerControl.cs index 4d366e07..d361f46d 100644 --- a/SparkleXrmSource/SparkleXrmUI/GridEditor/CrmPagerControl.cs +++ b/SparkleXrmSource/SparkleXrmUI/GridEditor/CrmPagerControl.cs @@ -107,8 +107,10 @@ public void gotoPrev(jQueryEvent e) PagingInfo paging = new PagingInfo(); paging.PageNum = state.pagingInfo.PageNum - 1; _dataView.SetPagingOptions(paging); + // #71 Move scroll bar to the top + Script.Literal("{0}.scrollRowToTop(0)", _grid); } - + } public void gotoNext(jQueryEvent e) @@ -119,7 +121,10 @@ public void gotoNext(jQueryEvent e) PagingInfo paging = new PagingInfo(); paging.PageNum = state.pagingInfo.PageNum + 1; _dataView.SetPagingOptions(paging); + // #71 Move scroll bar to the top + Script.Literal("{0}.scrollRowToTop(0)", _grid); } + } public void constructPagerUI() @@ -176,8 +181,7 @@ public void updatePager(PagingInfo pagingInfo) status.Text(string.Format("{0} - {1} of {2} ({3} selected)", pagingInfo.FromRecord, pagingInfo.ToRecord, pagingInfo.TotalRows, _dataView.GetSelectedRows().Length.ToString())); pageInfo.Text(string.Format("Page {0}", pagingInfo.PageNum + 1)); - // #71 Move scroll bar to the top - Script.Literal("{0}.scrollRowToTop(0)", _grid); + } diff --git a/SparkleXrmSource/SparkleXrmUI/GridEditor/EntityDataViewModel.cs b/SparkleXrmSource/SparkleXrmUI/GridEditor/EntityDataViewModel.cs index d09bca89..198c5085 100644 --- a/SparkleXrmSource/SparkleXrmUI/GridEditor/EntityDataViewModel.cs +++ b/SparkleXrmSource/SparkleXrmUI/GridEditor/EntityDataViewModel.cs @@ -173,6 +173,11 @@ public bool Contains(Entity Item) return false; } + public virtual void PreProcessResultsData(EntityCollection results) + { + // Allows overriding to change the results - prefiltering or adding items + + } public override void Refresh() { @@ -215,6 +220,7 @@ public override void Refresh() try { EntityCollection results = OrganizationServiceProxy.EndRetrieveMultiple(result, _entityType); + PreProcessResultsData(results); // Set data int i = firstRowIndex;