-
Continue reading →: Retrieve multiple records using OData & JQuery in CRM 2011
Hi, Below are the Jscript functions to retrieve multiple records using OData & JQuery. function retrieveMultiple(odataSetName, select, filter, successCallback) { var serverUrl = Xrm.Page.context.getServerUrl(); var ODATA_ENDPOINT = “/XRMServices/2011/OrganizationData.svc”; var odataUri = serverUrl + ODATA_ENDPOINT + “/” + odataSetName + “?”; if (select) { odataUri += “$select=” + select + “&”;…
-
Continue reading →: Refreshing Sub grid and Main grid using Jscript in CRM 2011
Hi, Below is the script to refresh the sub-grid var mySubGrid = Xrm.Page.ui.controls.get(“{sub-grid name}“); if (mySubGrid) { mySubGrid.refresh(); } To get the sub grid name Open the entity customization form In designer, double click on subgrid In the dialog window, copy the “Name” value To refresh the main…
-
Continue reading →: “Translations file is invalid” error while importing translations in CRM 2011
Hi, The other day, When I tried to import Translations (i.e., RajTranslations.zip folder with ‘Content_Types.xml & CrmTranslations.xml’ files), I was getting below exception Translations file is invalid. The compressed file must contain the following files in your root “[Content_Types].xml” and “CrmTranslations.xml” Reason:- The reason for this error was I zipped…
-
Continue reading →: Excel completed file level validation and repair – message while opening excel file
Hi, In one of my XRM implementation i used OpenXML.sdk to read/write excel files. I was getting below screen while opening the created excel file from .aspx page. Here is the code Iused to pop the excel file from .aspx page Response.ClearHeaders(); Response.ClearContent(); Response.ContentType = “application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml”; Response.AddHeader(“Content-Disposition”, “sample.xlsx”); Response.BinaryWrite(outputFileBytes); Response.Flush(); Response.End(); Fix :- There…
-
Continue reading →: Reading option set using JScript in CRM 2011
Hi, Below is the Jscript functions to read “Option set” and get the option text by option value. In this approach I have 3 methods and details are below getOptionSet() – Returns optionset object Parameters Entity Name (Entity logical name) Attribute Name (i.e., Option set field name) retrieveAsIfPublished (True/False) getTextByValue()…
-
Continue reading →: “Could not create type” error while browsing a web service
Hi, You may come across below error after you deploy a web service application on IIS and try to browse the .asmx file. Fix :- Below are few reasons that cause this issue Check your Application Pool of your hosted site is of .Net Framework 2.0 or higher Verify all your web service …
-
Continue reading →: Fields that are not valid were specified for the entity – Solution Import Error in CRM 2011
Hi, In one of my CRM 2011 deployments when I tried to import my solution from Development to Test environment I got below error Fields that are not valid were specified for the entity After examining the customization changes made we came to know the actual problem. Reason – We had an…
-
Continue reading →: Using Regular Expression and JScript to validate phone no format
Hi, I got a requirement to validate a CRM field with “Indian Telephone Number” format (i.e., 040-1234567). I opted to use regular expression and Jscript for format validation. Below is the JScript function function businessPhoneOnChange() { var telephone = Xrm.Page.data.entity.attributes.get(“telephone1”); // Regular expression with Indian Telephone format var regExp= /^[0-9]\d{2,4}-\d{6,8}$/; if…


