<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7044910934665757627</id><updated>2024-10-03T01:59:56.473+08:00</updated><category term="CRM 2011"/><category term="Javascript"/><category term="ASP.net C#"/><category term="CRM 2013"/><category term="C#"/><category term="SSRS 2008"/><category term="Free Software"/><category term="SQL Server"/><category term="XML"/><category term="Blogger 3dit"/><category term="Contact Us"/><category term="HTML"/><category term="Plugin"/><category term="Resco MobileCRM"/><category term="TFS"/><title type='text'>3|s Exploration &amp;amp; Knowledge</title><subtitle type='html'>Beginning of everything, everywhere and anytime.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://elsdesire.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://elsdesire.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10116315146057705597</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>83</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7044910934665757627.post-3948945395307749160</id><published>2015-01-13T15:28:00.003+08:00</published><updated>2015-01-13T15:28:18.211+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CRM 2013"/><category scheme="http://www.blogger.com/atom/ns#" term="Javascript"/><title type='text'>CRM 2013 Javascript Block Save</title><content type='html'>&lt;br /&gt;
&lt;b&gt;Script&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;function My_PreventSaveFunction(eContext, Message) {&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; alert(Message);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; eContext.getEventArgs().preventDefault();&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://elsdesire.blogspot.com/feeds/3948945395307749160/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7044910934665757627/3948945395307749160?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/3948945395307749160'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/3948945395307749160'/><link rel='alternate' type='text/html' href='http://elsdesire.blogspot.com/2015/01/crm-2013-javascript-block-save.html' title='CRM 2013 Javascript Block Save'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10116315146057705597</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7044910934665757627.post-1138097058906643059</id><published>2015-01-13T15:10:00.000+08:00</published><updated>2015-01-13T15:10:08.765+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CRM 2013"/><category scheme="http://www.blogger.com/atom/ns#" term="Javascript"/><title type='text'>CRM 2013 Javascript Filter Custom Lookup View Field (PreFiltering Method)</title><content type='html'>&lt;br /&gt;
&lt;b&gt;Issues:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
Changes in category effect custom filtering, then the lookup display on form will corrupt but when u click on lookup more its ok.&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;Script&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
var filter = &#39;&#39;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;function FilterListingViewCategory(Value) {&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; filter = &quot;&amp;lt;filter type=&#39;and&#39;&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&amp;lt;condition attribute=&#39;statecode&#39; operator=&#39;eq&#39; value=&#39;0&#39; /&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&amp;lt;condition attribute=&#39;vwlzs_category&#39; operator=&#39;in&#39;&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&amp;lt;value&amp;gt;&quot; + RegistrationId + &quot;&amp;lt;/value&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&amp;lt;/condition&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot;&amp;lt;/filter&amp;gt;&quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; preFilterLookupCategory(filter);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;function preFilterLookupCategory(filter) {&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Xrm.Page.getControl(&quot;vwlzs_aidcategorylk&quot;).addPreSearch(function () {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; addLookupFilterCategory(filter);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; });&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;function addLookupFilterCategory(filter) {&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Xrm.Page.getControl(&quot;vwlzs_aidcategorylk&quot;).addCustomFilter(filter);&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://elsdesire.blogspot.com/feeds/1138097058906643059/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7044910934665757627/1138097058906643059?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/1138097058906643059'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/1138097058906643059'/><link rel='alternate' type='text/html' href='http://elsdesire.blogspot.com/2015/01/crm-2013-javascript-filter-custom_13.html' title='CRM 2013 Javascript Filter Custom Lookup View Field (PreFiltering Method)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10116315146057705597</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7044910934665757627.post-6473648953639955236</id><published>2015-01-13T15:03:00.001+08:00</published><updated>2015-01-13T15:03:17.958+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CRM 2013"/><category scheme="http://www.blogger.com/atom/ns#" term="Javascript"/><title type='text'>CRM 2013 Javascript Filter Custom Lookup View Field (FetchXML)</title><content type='html'>&lt;br /&gt;
&lt;b&gt;Issues&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
This part doesn&#39;t work when user click on lookup for more because i&#39;m unable to set the default view fo the lookup. The user need to select the custom view by their own.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Script&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;function FilterListingViewAidCategory(Value) {&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; var RegistrationId = Xrm.Page.getAttribute(&quot;vwlzs_asnafcategory&quot;).getValue();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if (RegistrationId == null &amp;amp;&amp;amp; Value != null) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; RegistrationId == Value;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; var entityNumber = GetObjectTypeCode(&quot;vwlzs_aidsapplication&quot;);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; var FetchXML = &quot;&amp;lt;fetch version=&#39;1.0&#39; output-format=&#39;xml-platform&#39; mapping=&#39;logical&#39; distinct=&#39;false&#39;&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&amp;lt;entity name=&#39;vwlzs_category&#39;&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&amp;lt;attribute name=&#39;vwlzs_categoryid&#39; /&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&amp;lt;attribute name=&#39;vwlzs_name&#39; /&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&amp;lt;attribute name=&#39;createdon&#39; /&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&amp;lt;order attribute=&#39;vwlzs_name&#39; descending=&#39;false&#39; /&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&amp;lt;filter type=&#39;and&#39;&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&amp;lt;condition attribute=&#39;statecode&#39; operator=&#39;eq&#39; value=&#39;0&#39; /&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&amp;lt;condition attribute=&#39;vwlzs_categoryasnaf&#39; operator=&#39;in&#39;&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&amp;lt;value&amp;gt;&quot; + RegistrationId + &quot;&amp;lt;/value&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&amp;lt;/condition&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&amp;lt;/filter&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&amp;lt;/entity&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&amp;lt;/fetch&amp;gt;&quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; var layoutXml = &quot;&amp;lt;grid name=&#39;resultset&#39; object=&#39;10038&#39; jump=&#39;vwlzs_name&#39; select=&#39;1&#39; preview=&#39;1&#39; icon=&#39;1&#39;&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&amp;lt;row name=&#39;result&#39; id=&#39;vwlzs_categoryid&#39;&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&amp;lt;cell name=&#39;vwlzs_name&#39; width=&#39;300&#39; /&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&amp;lt;cell name=&#39;createdon&#39; width=&#39;150&#39; /&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&amp;lt;/row&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&amp;lt;/grid&amp;gt;&quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; var viewId = guid();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; var viewDisplayName = &quot;Filtered Based On Category&quot;;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Xrm.Page.getControl(&quot;vwlzs_aidcategorylk&quot;).addCustomView(viewId, &quot;vwlzs_category&quot;, viewDisplayName, FetchXML, layoutXml, true);&lt;br /&gt;
}&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://elsdesire.blogspot.com/feeds/6473648953639955236/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7044910934665757627/6473648953639955236?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/6473648953639955236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/6473648953639955236'/><link rel='alternate' type='text/html' href='http://elsdesire.blogspot.com/2015/01/crm-2013-javascript-filter-custom.html' title='CRM 2013 Javascript Filter Custom Lookup View Field (FetchXML)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10116315146057705597</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7044910934665757627.post-3863715343476234281</id><published>2015-01-13T14:59:00.000+08:00</published><updated>2015-01-13T14:59:06.307+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CRM 2013"/><category scheme="http://www.blogger.com/atom/ns#" term="Javascript"/><title type='text'>CRM 2013 Javascript Check CRM User Role in System</title><content type='html'>&lt;br /&gt;&lt;b&gt;Script&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;function CheckorNotInterBranch() {&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; var EntityId = Xrm.Page.ui.getFormType();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if (EntityId == 1) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Security.UserInRole.checkUserInRole([&quot;HQ Staff&quot;, &quot;System Customizer&quot;, &quot;Custom Role Name&quot;], function () {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Security.UserInRole.checkUserInRole([&quot;HQ Staff&quot;], function () {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //alert(&quot;valid&quot;); // The user is in one of the specifed roles.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Xrm.Page.getAttribute(&quot;vwlzs_interbranch&quot;).setValue(true);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; function () {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //alert(&quot;invalid&quot;); // The user is not in one of the specifed roles.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Xrm.Page.getAttribute(&quot;vwlzs_interbranch&quot;).setValue(false);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; //check new form&lt;br /&gt;
&amp;nbsp; &amp;nbsp; // Check user role when user role = HQ Staff then inter branch = yes&lt;br /&gt;
&amp;nbsp; &amp;nbsp; //var UserRoles = Xrm.Page.context.getUserRoles();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; // Check User role when user role = branch staff then inter branch = no&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//If the Security namespace object is not defined, create it.&lt;br /&gt;
if (typeof (Security) == &quot;undefined&quot;)&lt;br /&gt;
{ Security = {}; }&lt;br /&gt;
// Create Namespace container for functions in this library;&lt;br /&gt;
if (typeof (Security.UserInRole) == &quot;undefined&quot;) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Security.UserInRole = {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; isInRole: null,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; roleIdValues: [],&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; validFunction: null,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; invalidFunction: null,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; checkRoles: [],&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; checkUserInRole: function (roles, validFunc, invalidFunc) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; validFunction = validFunc;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; invalidFunction = invalidFunc;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; checkRoles = roles;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Security.UserInRole.getAllowedSecurityRoleIds();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; getAllowedSecurityRoleIds: function () {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var filter = &quot;&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (var i = 0; i &amp;lt; checkRoles.length; i++) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (filter == &quot;&quot;) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; filter = &quot;Name eq &#39;&quot; + checkRoles[i] + &quot;&#39;&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; filter += &quot; or Name eq &#39;&quot; + checkRoles[i] + &quot;&#39;&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Security.UserInRole.querySecurityRoles(&quot;?$select=RoleId,Name&amp;amp;$filter=&quot; + filter);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; validateSecurityRoles: function () {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; switch (Security.UserInRole.isInRole) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //If the user has already been discovered in role then call validFunc&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case true:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; validFunction.apply(this, []);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; default:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var userRoles = Xrm.Page.context.getUserRoles();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (var i = 0; i &amp;lt; userRoles.length; i++) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var userRole = userRoles[i];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (var n = 0; n &amp;lt; Security.UserInRole.roleIdValues.length; n++) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var role = Security.UserInRole.roleIdValues[n];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (userRole.toLowerCase() == role.toLowerCase()) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Security.UserInRole.isInRole = true;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Call function when role match found&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; validFunction.apply(this, []);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return true;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Call function when no match found&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; invalidFunction.apply(this, []);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; querySecurityRoles: function (queryString) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var req = new XMLHttpRequest();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var url = &quot;&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Try getClientUrl first (available post Rollup 12)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (Xrm.Page.context.getClientUrl) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; url = Xrm.Page.context.getClientUrl();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; url = Xrm.Page.context.getServerUrl();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; req.open(&quot;GET&quot;, url + &quot;/XRMServices/2011/OrganizationData.svc/RoleSet&quot; + queryString, true);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; req.setRequestHeader(&quot;Accept&quot;, &quot;application/json&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; req.setRequestHeader(&quot;Content-Type&quot;, &quot;application/json; charset=utf-8&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; req.onreadystatechange = function () {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (this.readyState == 4 /* complete */) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; req.onreadystatechange = null; //Addresses memory leak issue with IE.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (this.status == 200) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var returned = window.JSON.parse(this.responseText).d;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (var i = 0; i &amp;lt; returned.results.length; i++) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Security.UserInRole.roleIdValues.push(returned.results[i].RoleId);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (returned.__next != null) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //In case more than 50 results are returned.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // This will occur if an organization has more than 16 business units&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var queryOptions = returned.__next.substring((url + &quot;/XRMServices/2011/OrganizationData.svc/RoleSet&quot;).length);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Security.UserInRole.querySecurityRoles(queryOptions);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Now that the roles have been retrieved, try again.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Security.UserInRole.validateSecurityRoles();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var errorText;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (this.status == 12029)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; { errorText = &quot;The attempt to connect to the server failed.&quot;; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (this.status == 12007)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; { errorText = &quot;The server name could not be resolved.&quot;; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; errorText = window.JSON.parse(this.responseText).error.message.value;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch (e)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; { errorText = this.responseText }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; req.send();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; __namespace: true&lt;br /&gt;
&amp;nbsp; &amp;nbsp; };&lt;br /&gt;
}&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://elsdesire.blogspot.com/feeds/3863715343476234281/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7044910934665757627/3863715343476234281?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/3863715343476234281'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/3863715343476234281'/><link rel='alternate' type='text/html' href='http://elsdesire.blogspot.com/2015/01/crm-2013-javascript-check-crm-user-role.html' title='CRM 2013 Javascript Check CRM User Role in System'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10116315146057705597</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7044910934665757627.post-152226278088197417</id><published>2015-01-13T14:53:00.000+08:00</published><updated>2015-01-13T14:53:21.234+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CRM 2013"/><category scheme="http://www.blogger.com/atom/ns#" term="Javascript"/><title type='text'>CRM 2013 Javascript Disable form.</title><content type='html'>&lt;br /&gt;
&lt;b&gt;Script&lt;/b&gt;:&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;disableFormFields = function (onOff) {&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Xrm.Page.ui.controls.forEach(function (control, index) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (doesControlHaveAttribute(control)) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; control.setDisabled(onOff);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; });&lt;br /&gt;
} //Function to disable all the field in the form// true/false&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;doesControlHaveAttribute = function (control) {&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; var controlType = control.getControlType();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; return controlType != &quot;iframe&quot; &amp;amp;&amp;amp; controlType != &quot;webresource&quot; &amp;amp;&amp;amp; controlType != &quot;subgrid&quot;;&lt;br /&gt;
} //Sub disableFormFields// Check the form have control like iframe, webresource or subgrid&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;function onload() {&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;disableFormFields(true);&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://elsdesire.blogspot.com/feeds/152226278088197417/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7044910934665757627/152226278088197417?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/152226278088197417'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/152226278088197417'/><link rel='alternate' type='text/html' href='http://elsdesire.blogspot.com/2015/01/crm-2013-javascript-disable-form.html' title='CRM 2013 Javascript Disable form.'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10116315146057705597</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7044910934665757627.post-1295093522027859239</id><published>2015-01-13T14:50:00.004+08:00</published><updated>2015-01-13T14:50:35.546+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CRM 2013"/><category scheme="http://www.blogger.com/atom/ns#" term="Javascript"/><title type='text'>CRM 2013 Javascript Calculate Age Based On Date of Birth</title><content type='html'>&lt;br /&gt;
&lt;b&gt;Script&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;function CalculateAge() {&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; var DOB = Xrm.Page.getAttribute(&quot;vwlzs_dateofbirth&quot;).getValue();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; var todadate = new Date();&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if (DOB &amp;lt; todadate) {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (DOB != null) {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var d = new Date();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var n = d.getFullYear();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var TotalAge = n - DOB.getFullYear();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Xrm.Page.getAttribute(&quot;vwlzs_age&quot;).setValue(parseInt(TotalAge));&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Xrm.Page.getAttribute(&quot;vwlzs_age&quot;).setValue(null);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; else {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; alert(&quot;No future date allow!&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://elsdesire.blogspot.com/feeds/1295093522027859239/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7044910934665757627/1295093522027859239?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/1295093522027859239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/1295093522027859239'/><link rel='alternate' type='text/html' href='http://elsdesire.blogspot.com/2015/01/crm-2013-javascript-calculate-age-based.html' title='CRM 2013 Javascript Calculate Age Based On Date of Birth'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10116315146057705597</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7044910934665757627.post-7890980160751742381</id><published>2015-01-13T14:47:00.000+08:00</published><updated>2015-01-13T14:47:15.885+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CRM 2013"/><category scheme="http://www.blogger.com/atom/ns#" term="Javascript"/><title type='text'>CRM 2013 Javascript Populate Date of Birth and Age from NRIC/MyKad</title><content type='html'>&lt;br /&gt;
&lt;b&gt;Script&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;function PopulateDateofBirthAndAge(NRICValue) {&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; var var1 = value.substring(0, 2);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; var var2 = value.substring(2, 4);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; var var3 = value.substring(4, 6);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; var d = new Date();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; d.setDate(var3);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; d.setMonth(var2);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; d.setYear(var1);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; NRIC_TextInput(value, var1, var2, var3);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;function NRIC_TextInput(id, yearid, monthid, dayid) {&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; var value = id;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if (value &amp;amp;&amp;amp; value.length == 12) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var isValid = true;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var n = value.split(&quot;&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var Year = parseFloat(&quot;20&quot; + n[0] + n[1]);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var Month = parseFloat(n[2] + n[3]);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var Day = parseFloat(n[4] + n[5]);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var Now = new Date();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var Age = 0;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var sMonth = &quot;&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (Month &amp;lt; 1 || Month &amp;gt; 12) isValid = false;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (isValid) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (Year &amp;gt; Now.getFullYear()) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Year = Year - 100;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Age check on month and date reach ?&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Age = Now.getFullYear() - Year;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Age check on month and date reach ?&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Age = Now.getFullYear() - Year;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; switch (Month) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case 1:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sMonth = &quot;January&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (Day &amp;gt; 31 || Day &amp;lt;= 0) isValid = false;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case 2:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sMonth = &quot;February&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (Year % 4 == 0) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (Day &amp;gt; 29 || Day &amp;lt;= 0) isValid = false;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (Day &amp;gt; 28 || Day &amp;lt;= 0) isValid = false;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case 3:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sMonth = &quot;March&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (Day &amp;gt; 31 || Day &amp;lt;= 0) isValid = false;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case 4:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sMonth = &quot;April&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (Day &amp;gt; 30 || Day &amp;lt;= 0) isValid = false;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case 5:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sMonth = &quot;May&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (Day &amp;gt; 31 || Day &amp;lt;= 0) isValid = false;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case 6:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sMonth = &quot;June&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (Day &amp;gt; 30 || Day &amp;lt;= 0) isValid = false;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case 7:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sMonth = &quot;July&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (Day &amp;gt; 31 || Day &amp;lt;= 0) isValid = false;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case 8:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sMonth = &quot;August&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (Day &amp;gt; 31 || Day &amp;lt;= 0) isValid = false;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case 9:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sMonth = &quot;September&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (Day &amp;gt; 30 || Day &amp;lt;= 0) isValid = false;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case 10:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sMonth = &quot;October&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (Day &amp;gt; 31 || Day &amp;lt;= 0) isValid = false;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case 11:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sMonth = &quot;November&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (Day &amp;gt; 30 || Day &amp;lt;= 0) isValid = false;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case 12:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sMonth = &quot;December&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (Day &amp;gt; 31 || Day &amp;lt;= 0) isValid = false;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; default:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; isValid = false;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (isValid) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Xrm.Page.getAttribute(&quot;vwlzs_age&quot;).setValue(Age);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var DOB = new Date(Year, monthid - 1, dayid, 0, 0, 0);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Xrm.Page.getAttribute(&quot;vwlzs_dateofbirth&quot;).setValue(DOB);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; alert(&quot;Invalid NRIC Number.&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; else {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; alert(&quot;Invalid NRIC Number.&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://elsdesire.blogspot.com/feeds/7890980160751742381/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7044910934665757627/7890980160751742381?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/7890980160751742381'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/7890980160751742381'/><link rel='alternate' type='text/html' href='http://elsdesire.blogspot.com/2015/01/crm-2013-javascript-populate-date-of.html' title='CRM 2013 Javascript Populate Date of Birth and Age from NRIC/MyKad'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10116315146057705597</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7044910934665757627.post-8917752111116747001</id><published>2015-01-13T14:44:00.004+08:00</published><updated>2015-01-13T14:44:45.801+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CRM 2013"/><category scheme="http://www.blogger.com/atom/ns#" term="Javascript"/><title type='text'>CRM 2013 Javascript Define Gender Through NRIC/MyKad</title><content type='html'>&lt;br /&gt;
&lt;b&gt;Script&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;function DefineMaleFemale() {&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; var NRIC = Xrm.Page.getAttribute(&quot;vwlzs_identificationnum&quot;).getValue();&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if (NRIC != null) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var last = NRIC.charAt(NRIC.length - 1);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (isEven(last) == true) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Xrm.Page.getAttribute(&quot;vwlzs_gender&quot;).setValue(true); //Female&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Xrm.Page.getAttribute(&quot;vwlzs_gender&quot;).setValue(false); //Male&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;function isEven(value) {&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if (value % 2 == 0)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return true;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; else&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return false;&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://elsdesire.blogspot.com/feeds/8917752111116747001/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7044910934665757627/8917752111116747001?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/8917752111116747001'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/8917752111116747001'/><link rel='alternate' type='text/html' href='http://elsdesire.blogspot.com/2015/01/crm-2013-javascript-define-gender.html' title='CRM 2013 Javascript Define Gender Through NRIC/MyKad'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10116315146057705597</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7044910934665757627.post-1088232599030511663</id><published>2015-01-13T14:38:00.002+08:00</published><updated>2015-01-13T14:38:57.320+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CRM 2013"/><category scheme="http://www.blogger.com/atom/ns#" term="Javascript"/><title type='text'>CRM 2013 Javascript Refresh form </title><content type='html'>&lt;br /&gt;
&lt;b&gt;Script&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;function TriggerSubmit() {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Xrm.Page.data.save().then(successCallback, errorCallback);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;function successCallback() {&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Xrm.Page.data.setFormDirty(false);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; var Id = Xrm.Page.data.entity.getId();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Xrm.Utility.openEntityForm(&quot;vwlzs_register&quot;, Id);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;function errorCallback(attr1, attr2) {&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://elsdesire.blogspot.com/feeds/1088232599030511663/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7044910934665757627/1088232599030511663?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/1088232599030511663'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/1088232599030511663'/><link rel='alternate' type='text/html' href='http://elsdesire.blogspot.com/2015/01/crm-2013-javascript-refresh-form.html' title='CRM 2013 Javascript Refresh form '/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10116315146057705597</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7044910934665757627.post-5864124498283434041</id><published>2015-01-13T14:35:00.001+08:00</published><updated>2015-01-13T14:39:04.383+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CRM 2013"/><category scheme="http://www.blogger.com/atom/ns#" term="Javascript"/><title type='text'>CRM 2013 Javacript Validate Integer</title><content type='html'>&lt;br /&gt;
&lt;b&gt;Script&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;function CheckInteger(Field) {&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; var Result = Xrm.Page.getAttribute(Field).getValue();&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if (isInt(Result)) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Xrm.Page.getAttribute(Field).setValue(Result);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; else {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; alert(&quot;Input is not numeric&quot;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Xrm.Page.getAttribute(Field).setValue(null);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;function isInt(value) {&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; return !isNaN(value) &amp;amp;&amp;amp; parseInt(Number(value)) == value &amp;amp;&amp;amp; !isNaN(parseInt(value, 10));&lt;br /&gt;
&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://elsdesire.blogspot.com/feeds/5864124498283434041/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7044910934665757627/5864124498283434041?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/5864124498283434041'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/5864124498283434041'/><link rel='alternate' type='text/html' href='http://elsdesire.blogspot.com/2015/01/crm-2013-javacript-validate-integer.html' title='CRM 2013 Javacript Validate Integer'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10116315146057705597</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7044910934665757627.post-997877776249817312</id><published>2015-01-13T14:33:00.000+08:00</published><updated>2015-01-13T14:39:14.880+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CRM 2013"/><category scheme="http://www.blogger.com/atom/ns#" term="Javascript"/><title type='text'>CRM 2013 Javascript Validate Symbol</title><content type='html'>&lt;br /&gt;
&lt;b&gt;Script&lt;/b&gt;:&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;function validateSymbol(Field) {&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; var TCode = Xrm.Page.getAttribute(Field).getValue();&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if (/[^a-zA-Z0-9\-\/]/.test(TCode)) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; alert(&quot;Input is not alphanumeric&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Xrm.Page.getAttribute(Field).setValue(null);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://elsdesire.blogspot.com/feeds/997877776249817312/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7044910934665757627/997877776249817312?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/997877776249817312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/997877776249817312'/><link rel='alternate' type='text/html' href='http://elsdesire.blogspot.com/2015/01/javascript-validate-symbol.html' title='CRM 2013 Javascript Validate Symbol'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10116315146057705597</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7044910934665757627.post-4397482539870399177</id><published>2015-01-13T14:29:00.001+08:00</published><updated>2015-01-13T14:40:16.360+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CRM 2013"/><category scheme="http://www.blogger.com/atom/ns#" term="Javascript"/><title type='text'>CRM 2013 Remove all the subgrid add button </title><content type='html'>&lt;br /&gt;
Call it during On load (with certain condition) then all the sub grid add button in the form will be hidden.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Script&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
var intervalId;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;function makeReadOnly() {&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; try {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var subgridsLoaded = false;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Xrm.Page.ui.controls.get().forEach(function (control, index) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (control.setDisabled &amp;amp;&amp;amp; Xrm.Page.ui.getFormType() != 3) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; control.setDisabled(true);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else {&lt;br /&gt;
&lt;span style=&quot;color: #274e13;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // removeAddButtonFromSubGrid(control);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #274e13;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // subgridsLoaded = true;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if ($(&quot;div[id$=&#39;_crmGridTD&#39;]&quot;).length &amp;gt; 0 &amp;amp;&amp;amp; !subgridsLoaded) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; intervalId = setInterval(function () {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var subgridsArr = Xrm.Page.getControl(function (control, index) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return control.getControlType() == &#39;subgrid&#39;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; subgridsArr.forEach(function (control, index) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; removeButtonsFromSubGrid(control);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }, 500);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; catch (e) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; alert(&quot;makeReadOnly() Error: &quot; + e.message);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;function removeButtonsFromSubGrid(subgridControl) {&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if (intervalId) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $(&#39;#&#39; + subgridControl.getName() + &#39;_addImageButton&#39;).css(&#39;display&#39;, &#39;none&#39;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $(&#39;#&#39; + subgridControl.getName() + &#39;_openAssociatedGridViewImageButton&#39;).css(&#39;display&#39;, &#39;none&#39;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; clearInterval(intervalId);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://elsdesire.blogspot.com/feeds/4397482539870399177/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7044910934665757627/4397482539870399177?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/4397482539870399177'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/4397482539870399177'/><link rel='alternate' type='text/html' href='http://elsdesire.blogspot.com/2015/01/crm-2013-remove-all-subgrid-add-button.html' title='CRM 2013 Remove all the subgrid add button '/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10116315146057705597</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7044910934665757627.post-1449845878805581072</id><published>2015-01-13T14:20:00.004+08:00</published><updated>2015-01-13T14:20:30.990+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="TFS"/><title type='text'>How to remove TFS lock of other user </title><content type='html'>&lt;br /&gt;
&lt;u&gt;&lt;b&gt;Problem&lt;/b&gt;:&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
Window corrupt and need to be format and install  with new window with different PC name. After format notice that in &lt;b&gt;Team Foundation Server (TFS)&lt;/b&gt; certain file is lock from editing by old PC name.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Solution&lt;/u&gt;&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
From within Visual Studio 2012(and 2013):&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;File &lt;/b&gt;-&amp;gt; &lt;b&gt;Source Control&lt;/b&gt; -&amp;gt; &lt;b&gt;Advanced &lt;/b&gt;-&amp;gt; &lt;b&gt;Workspaces&lt;/b&gt;...&lt;br /&gt;
&lt;br /&gt;
In the dialog that came up, I checked &quot;&lt;b&gt;Show remote workspaces&lt;/b&gt;&quot; and the locked workspace came up in the window. I then selected it and clicked &quot;Remove&quot;.&lt;br /&gt;
&lt;br /&gt;
The locked file is release.&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://elsdesire.blogspot.com/feeds/1449845878805581072/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7044910934665757627/1449845878805581072?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/1449845878805581072'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/1449845878805581072'/><link rel='alternate' type='text/html' href='http://elsdesire.blogspot.com/2015/01/how-to-remove-tfs-lock-of-other-user.html' title='How to remove TFS lock of other user '/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10116315146057705597</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7044910934665757627.post-4676810996150776394</id><published>2014-03-21T15:18:00.003+08:00</published><updated>2014-03-21T15:18:36.413+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.net C#"/><category scheme="http://www.blogger.com/atom/ns#" term="CRM 2013"/><category scheme="http://www.blogger.com/atom/ns#" term="Plugin"/><title type='text'>Populate Regarding Field In CRM 2013 Using Plugin</title><content type='html'>&lt;br /&gt;
Populate regarding work with creating records.&lt;br /&gt;
&lt;br /&gt;
Here are my code (Im Creating new task with populated Regarding Field):&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;Entity newTask = new Entity(&quot;task&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;newTask[&quot;subject&quot;] = &quot;Document&quot; + DateTime.Now.ToShortDateString();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;newTask[&quot;description&quot;] = &quot;Description&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;newTask[&quot;regardingobjectid&quot;] = new Microsoft.Xrm.Sdk.EntityReference(&quot;account&quot;, account.Id);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;service.Create(newTask);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
Result:&lt;br /&gt;
&lt;br /&gt;
New Task will be created with subject field, description field and regarding field with value.</content><link rel='replies' type='application/atom+xml' href='http://elsdesire.blogspot.com/feeds/4676810996150776394/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7044910934665757627/4676810996150776394?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/4676810996150776394'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/4676810996150776394'/><link rel='alternate' type='text/html' href='http://elsdesire.blogspot.com/2014/03/populate-regarding-field-in-crm-2013.html' title='Populate Regarding Field In CRM 2013 Using Plugin'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10116315146057705597</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7044910934665757627.post-800626934880568424</id><published>2014-03-21T15:11:00.004+08:00</published><updated>2014-03-21T15:11:44.749+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CRM 2011"/><title type='text'>CRM Email Template Add Links With Related Field</title><content type='html'>&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11.0pt; line-height: 115%; mso-ansi-language: EN-MY; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11.0pt; line-height: 115%; mso-ansi-language: EN-MY; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;&amp;lt;a
href=&quot;www.google.com/?CompanyNumber=&lt;span style=&quot;background: yellow; mso-highlight: yellow;&quot;&gt;{!Contact:Company Number;}&quot;&lt;/span&gt;&amp;gt;Click
Here&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11.0pt; line-height: 115%; mso-ansi-language: EN-MY; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Calibri, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 15px; line-height: 16.866666793823242px;&quot;&gt;Note* Dont copy and paste the links. Manually type in the links.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Calibri, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 15px; line-height: 16.866666793823242px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
Result will appear as below:&lt;br /&gt;
&lt;br /&gt;
&lt;u style=&quot;color: blue;&quot;&gt;Click Here&lt;/u&gt; &amp;lt;- Sample Cannt Be Click</content><link rel='replies' type='application/atom+xml' href='http://elsdesire.blogspot.com/feeds/800626934880568424/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7044910934665757627/800626934880568424?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/800626934880568424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/800626934880568424'/><link rel='alternate' type='text/html' href='http://elsdesire.blogspot.com/2014/03/crm-email-template-add-links-with.html' title='CRM Email Template Add Links With Related Field'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10116315146057705597</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7044910934665757627.post-9128717243022780682</id><published>2014-03-21T15:07:00.004+08:00</published><updated>2014-03-21T15:07:51.915+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CRM 2011"/><title type='text'>CRM Solution Lifecycle Management</title><content type='html'>&lt;div class=&quot;MsoNormal&quot;&gt;
CRM Solution Lifecycle Management&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;a href=&quot;http://www.microsoft.com/en-us/download/details.aspx?id=39044&quot;&gt;http://www.microsoft.com/en-us/download/details.aspx?id=39044&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://elsdesire.blogspot.com/feeds/9128717243022780682/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7044910934665757627/9128717243022780682?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/9128717243022780682'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/9128717243022780682'/><link rel='alternate' type='text/html' href='http://elsdesire.blogspot.com/2014/03/crm-solution-lifecycle-management.html' title='CRM Solution Lifecycle Management'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10116315146057705597</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7044910934665757627.post-4653917954921063682</id><published>2014-03-21T15:07:00.001+08:00</published><updated>2014-03-21T15:07:07.843+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CRM 2011"/><title type='text'>Different between managed and unmanaged solutions</title><content type='html'>&lt;div style=&quot;background: white; line-height: 19.2pt; margin-bottom: 12.0pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;strong&gt;&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11.0pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Tahoma; mso-hansi-theme-font: minor-latin;&quot;&gt;Un-managed Solutions&lt;/span&gt;&lt;/strong&gt;&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11.0pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Tahoma; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;br /&gt;
- No restriction on what elements of the solution can be customised.&lt;br /&gt;
- Difficult to remove components. Entities, fields, web resources etc. have to
be manually removed. - - Even if a newer solution version contains an element
that has been deleted it will still exist.&lt;br /&gt;
- The solution just acts as a container for the components. If you delete the
solution the components still exist in the default solution.&lt;br /&gt;
- Not possible to lockdown components to prevent accidental or un-intentional
changes. (Only for those with customisation rights)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 19.2pt; margin-bottom: 12.0pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;strong&gt;&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11.0pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Tahoma; mso-hansi-theme-font: minor-latin;&quot;&gt;Managed Solutions&lt;/span&gt;&lt;/strong&gt;&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11.0pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Tahoma; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;background: white; line-height: 19.2pt; margin-bottom: 12.0pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11.0pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Tahoma; mso-hansi-theme-font: minor-latin;&quot;&gt;- Can set elements of the solution
such as create views, change field properties, add fields etc.&lt;br /&gt;
- Solution cannot be exported.&lt;br /&gt;
- Any changes including field removal will happen automatically when changes in
new version.&lt;br /&gt;
- Can be preventing from damaging your solution.&lt;br /&gt;
- Risk of data loss if you remove the solution as all customisations will be
removed&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://elsdesire.blogspot.com/feeds/4653917954921063682/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7044910934665757627/4653917954921063682?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/4653917954921063682'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/4653917954921063682'/><link rel='alternate' type='text/html' href='http://elsdesire.blogspot.com/2014/03/different-between-managed-and-unmanaged.html' title='Different between managed and unmanaged solutions'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10116315146057705597</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7044910934665757627.post-511579664430516066</id><published>2014-03-21T15:06:00.002+08:00</published><updated>2014-03-21T15:06:34.888+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CRM 2011"/><title type='text'>Maintain and Overwrite Customization during Importing</title><content type='html'>&lt;ul style=&quot;margin-top: 0cm;&quot; type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 18.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt; vertical-align: baseline;&quot;&gt;Maintain
     customizations (recommended): Selecting this option will maintain any
     unmanaged customizations performed on components but also implies that
     some of the updates included in this solution will not take effect.&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 18.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt; vertical-align: baseline;&quot;&gt;Overwrite
     Customizations: Selecting this option overwrites any unmanaged
     customizations previously performed on components included in this
     solution. All updates included in this solution will take effect.&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;/ul&gt;
</content><link rel='replies' type='application/atom+xml' href='http://elsdesire.blogspot.com/feeds/511579664430516066/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7044910934665757627/511579664430516066?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/511579664430516066'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/511579664430516066'/><link rel='alternate' type='text/html' href='http://elsdesire.blogspot.com/2014/03/maintain-and-overwrite-customization.html' title='Maintain and Overwrite Customization during Importing'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10116315146057705597</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7044910934665757627.post-1794800380673274145</id><published>2013-12-18T12:00:00.006+08:00</published><updated>2013-12-18T12:00:44.352+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CRM 2011"/><title type='text'>CRM 2011 Importing Data Limit/ Maximum Importing Data</title><content type='html'>&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;u&gt;Data Import Wizard Will not upload files past 32mb&lt;/u&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Let say if your file is around 200mb in size. The web.config file has the maximum file size in it, so you can edit it to allow for bigger sizes or break the file up into smaller chunks.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Recommended&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;I prefer to temporarily raise the limits. Note. the data you are importing will takes times.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;b&gt;Default file Location&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;u&gt;C:\Program Files\Microsoft Dynamics CRM Data Migration Manager\DMClient\res\web&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;file web.config&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Default data in the file&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&amp;lt;configuration&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&amp;lt;system.web&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&amp;lt;httpRuntime executionTimeout=&quot;1200&quot; maxRequestLength=&quot;&lt;span style=&quot;color: red;&quot;&gt;32768&lt;/span&gt;&quot;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&amp;lt;compilation defaultLanguage=&quot;C#&quot; debug=&quot;false&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&amp;lt;assemblies&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&amp;lt;add assembly=&quot;Microsoft.Crm, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&quot;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&amp;lt;add assembly=&quot;Microsoft.Crm.Sdk, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&quot;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&amp;lt;add assembly=&quot;Microsoft.Crm.SdkTypeProxy, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&quot;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&amp;lt;add assembly=&quot;Microsoft.Crm.Platform.Sdk, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&quot;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&amp;lt;/assemblies&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&amp;lt;/compilation&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&amp;lt;authentication mode=&quot;Windows&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&amp;lt;identity impersonate=&quot;true&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&amp;lt;/system.web&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&amp;lt;/configuration&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;I choose to modify maxRequestLength=&quot;32768&quot; to be maxRequestLength=&quot;&lt;span style=&quot;color: red;&quot;&gt;300000&lt;/span&gt;&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://elsdesire.blogspot.com/feeds/1794800380673274145/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7044910934665757627/1794800380673274145?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/1794800380673274145'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/1794800380673274145'/><link rel='alternate' type='text/html' href='http://elsdesire.blogspot.com/2013/12/crm-2011-importing-data-limit-maximum.html' title='CRM 2011 Importing Data Limit/ Maximum Importing Data'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10116315146057705597</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7044910934665757627.post-1381026660240145323</id><published>2013-11-22T15:17:00.001+08:00</published><updated>2013-11-22T15:17:10.864+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CRM 2011"/><title type='text'>CRM 2011 Microsoft CRM Email Router Service Not Running</title><content type='html'>&lt;br /&gt;
Step 1 - Run Services.msc&lt;br /&gt;
Step 2 - Locate Microsoft CRM Email Router&lt;br /&gt;
Step 3 - Start the services</content><link rel='replies' type='application/atom+xml' href='http://elsdesire.blogspot.com/feeds/1381026660240145323/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7044910934665757627/1381026660240145323?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/1381026660240145323'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/1381026660240145323'/><link rel='alternate' type='text/html' href='http://elsdesire.blogspot.com/2013/11/crm-2011-microsoft-crm-email-router.html' title='CRM 2011 Microsoft CRM Email Router Service Not Running'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10116315146057705597</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7044910934665757627.post-1328074642233136574</id><published>2013-08-30T12:16:00.002+08:00</published><updated>2013-08-30T12:16:11.202+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.net C#"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="CRM 2011"/><category scheme="http://www.blogger.com/atom/ns#" term="Javascript"/><title type='text'>Pro Rate Calculation (Rental And Service Cost)</title><content type='html'>&lt;b&gt;Problem &lt;/b&gt;: How does pro rate work for rental.&lt;br /&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;*Note : Its different from all company.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;There are 6 Condition will hit when u do pro rate calculation&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;1. Rental Start &amp;lt;= Charge Start,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;Rental Start&lt;/span&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&amp;nbsp;&amp;lt; Rental End &amp;lt; Charge End.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;2.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;Rental End&lt;/span&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&amp;gt; Rental&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;Start&lt;/span&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&amp;lt; Charge End.,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;Rental&lt;/span&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;End &amp;gt;=&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;Charge End.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;3. Rental Start &amp;lt;= Charge Start, Rental End &amp;gt;=&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;Charge End.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;4.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;Rental Start &amp;gt; Charge Start,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;Rental End &amp;lt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;Charge End.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;5.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;Rental Start &amp;lt; Charge Start,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;Rental End = Charge End.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;6. Rental Start = Rental End.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Int32 DropdownMonth = 8;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Int32 DropdownYear = 2013;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;int32 DaysActualPerMonth = 0;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;int32 DaysPerMonth = 0;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;// Eg. August bill September Rental&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Int32 DaysInMonth = DateTime.DaysInMonth(DropdownYear, DropdownMonth + 1);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;DateTime FirstDayOfTheMonth = GetFirstDayOfMonth(DropdownYear, DropdownMonth + 1);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;DateTime LastDayOfTheMonth = GetLastDayOfMonth(DropdownYear, DropdownMonth + 1);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;DateTime RentalCommenceDate = RentalCostCommenceDate; //Get Rental Commence Date&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;DateTime RentalDueDate = RentalCostDueDate; // Get Rental Due Date&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;//ParameterSetDateTime; &amp;nbsp;Equal to previous generation date. May bill invoice date = Invoice date (June Date)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;if (RentalCommenceDate &amp;lt;= FirstDayOfTheMonth &amp;amp;&amp;amp; RentalDueDate &amp;gt; RentalCommenceDate &amp;amp;&amp;amp; RentalDueDate &amp;lt; LastDayOfTheMonth)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;nbsp; &amp;nbsp; //Return Partial Rental Amount (A)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; DaysActualPerMonth = DaysInMonth;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; DaysPerMonth = GetDaysBetweenDates(FirstDayOfTheMonth, RentalDueDate) + 1;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;else if (RentalCommenceDate &amp;gt; FirstDayOfTheMonth &amp;amp;&amp;amp; RentalCommenceDate &amp;lt; LastDayOfTheMonth &amp;amp;&amp;amp; RentalDueDate &amp;gt;= LastDayOfTheMonth)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;nbsp; &amp;nbsp; //Return Partial Rental Amount (B)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; DaysActualPerMonth = DaysInMonth;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; DaysPerMonth = GetDaysBetweenDates(RentalCommenceDate, LastDayOfTheMonth) + 1;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;else if (RentalCommenceDate &amp;lt;= FirstDayOfTheMonth &amp;amp;&amp;amp; RentalDueDate &amp;gt;= LastDayOfTheMonth)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;nbsp; &amp;nbsp; //Return Full Rental Amount (C)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; DaysActualPerMonth = DaysInMonth;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; DaysPerMonth = DaysInMonth;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;else if (RentalCommenceDate &amp;gt; FirstDayOfTheMonth &amp;amp;&amp;amp; RentalDueDate &amp;gt; RentalCommenceDate &amp;amp;&amp;amp; RentalDueDate &amp;lt; LastDayOfTheMonth)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;nbsp; &amp;nbsp; //Return Partial Rental Amount (D)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; DaysActualPerMonth = DaysInMonth;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; DaysPerMonth = GetDaysBetweenDates(RentalCommenceDate, RentalDueDate) + 1;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;else if (RentalCommenceDate &amp;lt; FirstDayOfTheMonth &amp;amp;&amp;amp; RentalDueDate &amp;gt; RentalCommenceDate &amp;amp;&amp;amp; RentalDueDate == LastDayOfTheMonth)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;nbsp; &amp;nbsp; //Return Partial Rental Amount (E)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; DaysActualPerMonth = DaysInMonth;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; DaysPerMonth = 1;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;else if (RentalCommenceDate == RentalDueDate)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;nbsp; &amp;nbsp; //Return Partial Rental Amount = One Day Rental (F)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; DaysActualPerMonth = DaysInMonth;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; DaysPerMonth = 1;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;else&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; //Nothing&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://elsdesire.blogspot.com/feeds/1328074642233136574/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7044910934665757627/1328074642233136574?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/1328074642233136574'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/1328074642233136574'/><link rel='alternate' type='text/html' href='http://elsdesire.blogspot.com/2013/08/pro-rate-calculation-rental-and-service.html' title='Pro Rate Calculation (Rental And Service Cost)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10116315146057705597</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7044910934665757627.post-2096405505671504476</id><published>2013-08-30T11:54:00.004+08:00</published><updated>2013-08-30T11:54:45.292+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.net C#"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>C# Set DateTime Variables Time to Default Time (12:00:00:00)</title><content type='html'>&lt;b&gt;To Standardize the Time for all DateTime Value.&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;String NewRentalCommenceDate = RentalCommenceDate.ToShortDateString();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;RentalCommenceDate = Convert.ToDateTime(NewRentalCommenceDate);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;String NewRentalDueDate = RentalDueDate.ToShortDateString();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;RentalDueDate = Convert.ToDateTime(NewRentalDueDate);&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://elsdesire.blogspot.com/feeds/2096405505671504476/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7044910934665757627/2096405505671504476?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/2096405505671504476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/2096405505671504476'/><link rel='alternate' type='text/html' href='http://elsdesire.blogspot.com/2013/08/c-set-datetime-variables-time-to.html' title='C# Set DateTime Variables Time to Default Time (12:00:00:00)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10116315146057705597</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7044910934665757627.post-8722970284476473655</id><published>2013-08-30T11:46:00.005+08:00</published><updated>2013-08-30T11:46:56.014+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.net C#"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>C# Get 1 Day of The Month And Last Day of The Month</title><content type='html'>&lt;b&gt;Problem &lt;/b&gt;: Getting first and last day of the month.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Solution&amp;nbsp;&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;nbsp;// Get Last Day Of The Month&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public static DateTime GetLastDayOfMonth(int year, int month)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; return new DateTime(year, month, DateTime.DaysInMonth(year, month));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;// Get 1 Day Of The Month&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public static DateTime GetFirstDayOfMonth(int year, int month)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; return new DateTime(year, month, 1);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://elsdesire.blogspot.com/feeds/8722970284476473655/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7044910934665757627/8722970284476473655?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/8722970284476473655'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/8722970284476473655'/><link rel='alternate' type='text/html' href='http://elsdesire.blogspot.com/2013/08/c-get-1-day-of-month-and-last-day-of.html' title='C# Get 1 Day of The Month And Last Day of The Month'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10116315146057705597</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7044910934665757627.post-7433710244159971442</id><published>2013-08-30T11:45:00.000+08:00</published><updated>2013-08-30T11:45:01.860+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.net C#"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>C# Get Duration of Days Between 2 Dates</title><content type='html'>&lt;b&gt;Problem &lt;/b&gt;: How to get duration of days between two dates.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Solution &lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;// Get Date Between Two Dates&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;private int GetDaysBetweenDates(DateTime firstDate, DateTime secondDate)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; return secondDate.Subtract(firstDate).Days;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://elsdesire.blogspot.com/feeds/7433710244159971442/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7044910934665757627/7433710244159971442?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/7433710244159971442'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/7433710244159971442'/><link rel='alternate' type='text/html' href='http://elsdesire.blogspot.com/2013/08/c-get-duration-of-days-between-2-dates.html' title='C# Get Duration of Days Between 2 Dates'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10116315146057705597</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7044910934665757627.post-691505118734010257</id><published>2013-08-30T11:43:00.001+08:00</published><updated>2013-08-30T11:43:04.768+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.net C#"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>C# Get Week Number In Year</title><content type='html'>&lt;b&gt;Problem &lt;/b&gt;: How do I get number of week per year.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Solution &lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;// Get Num Of Week Per Year&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;public static int Iso8601WeekNumber(DateTime dt)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;System.Globalization.CultureInfo ci = System.Threading.Thread.CurrentThread.CurrentCulture;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;int weekNumOnMonth = ci.Calendar.GetWeekOfYear(dt, ci.DateTimeFormat.CalendarWeekRule, ci.DateTimeFormat.FirstDayOfWeek);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;return weekNumOnMonth;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Reference&lt;/b&gt;:&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;using System.Globalization;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://elsdesire.blogspot.com/feeds/691505118734010257/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7044910934665757627/691505118734010257?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/691505118734010257'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7044910934665757627/posts/default/691505118734010257'/><link rel='alternate' type='text/html' href='http://elsdesire.blogspot.com/2013/08/c-get-week-number-in-year.html' title='C# Get Week Number In Year'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10116315146057705597</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>