Dynamic URL

To create dynamic URL in MS CRM use following format organisationUrl + “/main.aspx?etc=” + ObjectTypeCode + “&id=” + GUID + “&pagetype=entityrecord”; To get organisation URL in JS use ‘Xrm.Page.context.getClientUrl()’ Here you will get the ObjetTypeCode of CRM’s default entities. For more info go here Also to insert dynamics URL in email template, there is option to…

Create email and send from MS CRM

To send email in CRM, a workflow can be used (out of box or custom workflow) Out of box way Create workflow in CRM and click on ‘Send Email’ button as shown below Then select option of email template or on the fly template. We will explore on the fly template, to open it click…

MS CRM Workflow: input/output arguments

Some time we need to send out or take inputs for custom workflows dynamically. To do so MS CRM provided input/output arguments, syntax of it is Input arguments [Input(“data type input”)] [Default(“00.00″)] public InArgument AtrName{ get; set; } Output arguments [Output(“data type output”)] [Default(“00.00″)] public OutArgument AtrName{ get; set; }

New features in MS CRM 2015

Create / Update with just a single request Previously, In CRM we have check if data exist then update else create data, but now using ‘UpsertRequest ‘ request we can achieve it. Here is the example // Define the Alternate key which uniquely identifies the record KeyAttributeCollection acckeys = new KeyAttributeCollection(); acckeys.Add(“accountnumber”, “ASH001″);

Remove Auto-Save

MS CRM 2013 provided auto save functionality. CRM will save your changes automatically by each 30 sec. But sometime you need to remove this feature from CRM. To do that go to ‘System Settings’ and uncheck the enable auto save for all forms

Retrive data from MS CRM by QueryExpression

Many time we needs to retrieve data from MS CRM, for that we can user power of MS CRM SDK with query expression. Retrieve simple data with some conditions form a single entity QueryExpression query = new QueryExpression(Entitylogicalname); query.ColumnSet = new ColumnSet(true); query.Criteria.AddCondition(“mobileno”, ConditionOperator.NotNull); query.Criteria.AddCondition(“surname”, ConditionOperator.Equal, “Kant”); EntityCollection queryData = CRMConnection._organizationService.RetrieveMultiple(query);

MS CRM – Get optionset value from its text

Get optionset value from its text in MS CRM public static OptionSetValue getOptionSetValue(string entityName, string attributeName, string optionsetText) { int optionSetValue = 0; try { //create query fro optiuonset RetrieveAttributeRequest retrieveAttributeRequest = new RetrieveAttributeRequest(); retrieveAttributeRequest.EntityLogicalName = entityName; retrieveAttributeRequest.LogicalName = attributeName; retrieveAttributeRequest.RetrieveAsIfPublished = true;