The post Querying Order By Link Entity with Fetch XML appeared first on CRM Kitchen.
]]><fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true"> <entity name="contact"> <attribute name="fullname" /> <attribute name="telephone1" /> <attribute name="contactid" /> <link-entity name="contactquotes" from="contactid" to="contactid" visible="false" intersect="true"> <link-entity name="quote" from="quoteid" to="quoteid" alias="aa"> <order attribute="createdon" descending="false" /> </link-entity> </link-entity> </entity> </fetch>
The post Querying Order By Link Entity with Fetch XML appeared first on CRM Kitchen.
]]>The post CRM Tips : Javascript Stop Form Saving appeared first on CRM Kitchen.
]]>function formOnSave(context) { var saveEvt = context.getEventArgs(); if (Xrm.Page.getAttribute("fieldname").getValue() == null) { saveEvt.preventDefault(); } }
Dont forget to click “Pass execution context as first parameter” on Form Properties.
preventDefault : Cancels the save operation, but all remaining handlers for the event will still be executed.
https://msdn.microsoft.com/en-us/library/gg509060.aspx
The post CRM Tips : Javascript Stop Form Saving appeared first on CRM Kitchen.
]]>The post ExecuteMultipleRequest For Bulk Operation appeared first on CRM Kitchen.
]]>1000
. So, for Online CRM, maximum 1000
requests can be executed at a time.
// Create an ExecuteMultipleRequest object. requestWithResults = new ExecuteMultipleRequest() { // Assign settings that define execution behavior: continue on error, return responses. Settings = new ExecuteMultipleSettings() { ContinueOnError = false, ReturnResponses = true }, // Create an empty organization request collection. Requests = new OrganizationRequestCollection() }; // Create several (local, in memory) entities in a collection. EntityCollection input = GetCollectionOfEntitiesToCreate(); // Add a CreateRequest for each entity to the request collection. foreach (var entity in input.Entities) { CreateRequest createRequest = new CreateRequest { Target = entity }; requestWithResults.Requests.Add(createRequest); } // Execute all the requests in the request collection using a single web method call. ExecuteMultipleResponse responseWithResults = (ExecuteMultipleResponse)_serviceProxy.Execute(requestWithResults); // Display the results returned in the responses. foreach (var responseItem in responseWithResults.Responses) { // A valid response. if (responseItem.Response != null) DisplayResponse(requestWithResults.Requests[responseItem.RequestIndex], responseItem.Response); // An error has occurred. else if (responseItem.Fault != null) DisplayFault(requestWithResults.Requests[responseItem.RequestIndex], responseItem.RequestIndex, responseItem.Fault); }
Here is another example of changing the State and Status of records by ExecuteMultipleRequest.
for (int i = 0; i < records.Entities.Count; i++) { SetStateRequest setStateReq = new SetStateRequest(); setStateReq.EntityMoniker = new EntityReference(); setStateReq.EntityMoniker.Id = records.Entities[i].Id; setStateReq.EntityMoniker.LogicalName = records.Entities[i].LogicalName; setStateReq.State = new OptionSetValue(0); setStateReq.Status = new OptionSetValue(1); req.Requests.Add(setStateReq); } var res = service.Execute(req) as ExecuteMultipleResponse;
More info : https://msdn.microsoft.com/en-us/library/jj863631.aspx
The post ExecuteMultipleRequest For Bulk Operation appeared first on CRM Kitchen.
]]>The post Trigger a Workflow on CRM 2015 using C# appeared first on CRM Kitchen.
]]>// Create an ExecuteWorkflow request. ExecuteWorkflowRequest request = new ExecuteWorkflowRequest() { WorkflowId = _workflowId, EntityId = _leadId }; // Execute the workflow. ExecuteWorkflowResponse response = (ExecuteWorkflowResponse)_serviceProxy.Execute(request);
Also this request is supported by Microsoft Dynamics CRM 2015 and Microsoft Dynamics CRM Online 2015 Update.
Source : https://msdn.microsoft.com/en-us/library/gg309600.aspx
The post Trigger a Workflow on CRM 2015 using C# appeared first on CRM Kitchen.
]]>The post Save the form with Callback functions on CRM 2015 appeared first on CRM Kitchen.
]]>Xrm.Page.data.save(saveOptions).then(successCallback, errorCallback)
Saves the record asynchronously with the option to set callback functions to be executed after the save operation is completed.
With Microsoft Dynamics CRM Online 2015 Update 1 or later you can also set an object to control how appointment, recurring appointment, or service activity records are processed.
Xrm.Page.data.save().then( function() { console.log("success"); Xrm.Utility.openEntityForm(entityname,recordId); }, function(errorCode,message) { console.log(message); } );
Xrm.Page.data.save().then( function() { //save worked... Xrm.Page.data.refresh(); }, function() { console.log("save failed"); } );
window.location.reload(true); or location.reload(); or window.location = document.url;
These scripts cannot work for CRM 2013 and higher version. So you have to use callback functions after saving.
Source : https://msdn.microsoft.com/en-us/library/dn481607.aspx
The post Save the form with Callback functions on CRM 2015 appeared first on CRM Kitchen.
]]>The post How to get the type of attribute on CRM using Javascript ? appeared first on CRM Kitchen.
]]>Returns a string value that represents the type of attribute.
Xrm.Page.getAttribute(fieldname).getAttributeType();
This method will return one of the following string values:
Returns a string value that represents formatting options for the attribute.
This method will return one of the following string values or null:
Application Field Type | Format Option | Attribute Type | Format Value |
---|---|---|---|
Date and Time | Date Only | datetime | date |
Date and Time | Date and Time | datetime | datetime |
Whole Number | Duration | integer | duration |
Single Line of Text | string | ||
Whole Number | Language | optionset | language |
Whole Number | None | integer | none |
Single Line of Text | Text Area | string | textarea |
Single Line of Text | Text | string | text |
Single Line of Text | Ticker Symbol | string | tickersymbol |
Single Line of Text | Phone | string | phone |
Whole Number | Time Zone | optionset | timezone |
Single Line of Text | Url | string | url |
Source : https://msdn.microsoft.com/en-us/library/gg334409.aspx#BKMK_getAttributeType
The post How to get the type of attribute on CRM using Javascript ? appeared first on CRM Kitchen.
]]>The post Microsoft Dynamics CRM 2015 Resources for CRM Developers appeared first on CRM Kitchen.
]]>Also you can find all resources on Guido Preite’s blog for all version.
Download link: http://www.microsoft.com/en-us/download/details.aspx?id=44567
https://www.microsoft.com/en-US/dynamics/crm-customer-center/
https://www.microsoft.com/en-US/dynamics/crm-customer-center/ebooks-and-videos.aspx
Download link: http://www.microsoft.com/en-us/download/details.aspx?id=46908
Download link: http://www.microsoft.com/en-us/download/details.aspx?id=46552
Download link: http://www.microsoft.com/en-us/download/details.aspx?id=45015
Download link: http://www.microsoft.com/en-us/download/details.aspx?id=46371
Download link: http://www.microsoft.com/en-us/download/details.aspx?id=45017
Download link: http://www.microsoft.com/en-us/download/details.aspx?id=45535
Download link: http://www.microsoft.com/en-us/download/details.aspx?id=17331
Download link: https://www.microsoft.com/en-us/download/details.aspx?id=45023
Download link: http://www.microsoft.com/en-us/download/details.aspx?id=43108
Download link: http://www.microsoft.com/en-us/download/details.aspx?id=45013
Download link: http://www.microsoft.com/en-us/download/details.aspx?id=45018
https://support.microsoft.com/en-us/kb/3018360
The post Microsoft Dynamics CRM 2015 Resources for CRM Developers appeared first on CRM Kitchen.
]]>The post CRM 2015 .NET Framework 4.5.2 Version appeared first on CRM Kitchen.
]]>The type or namespace name ‘Xrm’ does not exist in the namespace ‘Microsoft’ (are you missing an assembly reference?)
You have to change .NET Framework version in your projects, if you use CRM 2015
If you say “.NET Framework 4.5.2 not showing in Visual Studio” or “How to select .NET 4.5.2 as a target framework in Visual Studio ? “, follow the links below.
You can find some helpful links about that :
https://support.microsoft.com/en-us/kb/3018360
Microsoft.Xrm.Sdk version : 7.0.0.0
https://www.microsoft.com/en-us/download/details.aspx?id=42637
This pack contains the following components :
https://msdn.microsoft.com/en-us/library/dn481609.aspx
http://blogs.msdn.com/b/dotnet/archive/2014/08/07/moving-to-the-net-framework-4-5-2.aspx
The post CRM 2015 .NET Framework 4.5.2 Version appeared first on CRM Kitchen.
]]>The post CRM Online 2015 Debugging appeared first on CRM Kitchen.
]]>We use Plugin Registration Tool for deployment and debugging because there is no CRM Developer Toolkit for CRM 2015. If you dont find this tool you can download latest CRM 2015 SDK. Follow the steps to debug plugins registered for online version.
Here creation of Account which trigger the plugin.
The Plugin throws an exception and Business Process Dialog is displayed, click Download Log File and save this file.
Now debug dialog will open and select the file you downloaded ErrorDetails.txt for Profile Location. Then select the Plugin assembly dll where dll and pdb files available to debug.
Open the plugin solution in Visual Studio and then place the break point to debug, attach the debugger to PluginRegistration.exe process.
Also I recommend you to read these posts and video :
I reviewed the article by Guru Prasad which was really helpful in getting this article together.
The post CRM Online 2015 Debugging appeared first on CRM Kitchen.
]]>The post Dynamics CRM 2013 Developer Toolkit for Visual Studio 2013 appeared first on CRM Kitchen.
]]>Normally there is no CRM Developer Toolkit installation file for Visual Studio 2013. But you can install it with some customization.
The post Dynamics CRM 2013 Developer Toolkit for Visual Studio 2013 appeared first on CRM Kitchen.
]]>