Plugin – CRM Kitchen http://crmkitchen.com Microsoft Dynamic CRM Tue, 25 Oct 2016 14:58:06 +0000 en-US hourly 1 https://wordpress.org/?v=4.6.1 ExecuteMultipleRequest For Bulk Operation http://crmkitchen.com/executemultiplerequest-bulk-operation/ http://crmkitchen.com/executemultiplerequest-bulk-operation/#respond Sat, 01 Aug 2015 19:45:21 +0000 http://crmkitchen.com/?p=213 You can use the ExecuteMultipleRequest message to support higher throughput bulk message passing scenarios in Microsoft Dynamics CRM 2015 and Microsoft Dynamics CRM Online 2015 Update, particularly in the case of Microsoft Dynamics CRM Online where Internet latency can be the largest limiting factor. ExecuteMultipleRequest accepts an input collection of message Requests, executes each of […]

The post ExecuteMultipleRequest For Bulk Operation appeared first on CRM Kitchen.

]]>
You can use the ExecuteMultipleRequest message to support higher throughput bulk message passing scenarios in Microsoft Dynamics CRM 2015 and Microsoft Dynamics CRM Online 2015 Update, particularly in the case of Microsoft Dynamics CRM Online where Internet latency can be the largest limiting factor. ExecuteMultipleRequest accepts an input collection of message Requests, executes each of the message requests in the order they appear in the input collection, and optionally returns a collection of Responses containing each message’s response or the error that occurred. Each message request in the input collection is processed in a separate database transaction.ExecuteMultipleRequest is executed by using the IOrganizationService.Execute method.

  • For Online CRM, maximum Batch Size is 1000. So, for Online CRM, maximum 1000 requests can be executed at a time.
  • For On Premise, Batch Size can be increased.

 

// 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.

]]>
http://crmkitchen.com/executemultiplerequest-bulk-operation/feed/ 0
CRM Online 2015 Debugging http://crmkitchen.com/crm-2015-online-debugging/ http://crmkitchen.com/crm-2015-online-debugging/#respond Sat, 04 Jul 2015 11:54:41 +0000 http://crmkitchen.com/?p=108 How to Debug CRM Online 2015 Plugin ? 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. Connect to Microsoft Dynamics CRM […]

The post CRM Online 2015 Debugging appeared first on CRM Kitchen.

]]>
How to Debug CRM Online 2015 Plugin ?

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.

Connect to Microsoft Dynamics CRM Online 2015 Server

CRM Online 2015 Debugging

 

Install Profiler in the Plugin Registration Tool

CRM 2015 Online Debugging

Select a Plugin step and click Start Profiling

CRM Online 2015 Debugging

Perform the operation which trigger the plugin in CRM

Here creation of Account which trigger the plugin.

Click Download Log File and Save this file

CRM Online 2015 Debugging

The Plugin throws an exception and Business Process Dialog is displayed, click Download Log File and save this file.

Click Debug in the Plugin Registration Tool

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.

CRM Online 2015 Debugging

Attach the PluginRegistration.exe process in Visual Studio

Open the plugin solution in Visual Studio and then place the break point to debug, attach the debugger to PluginRegistration.exe process.

CRM Online 2015 Debugging

Click Start Execution in the Plugin Registration Tool’s Dialog

CRM Online 2015 Debugging

Now Debugger will start debugging from the break point in the Visual Studio.

CRM Online 2015 Debugging

 

 

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.

]]>
http://crmkitchen.com/crm-2015-online-debugging/feed/ 0
Dynamics CRM 2013 Developer Toolkit for Visual Studio 2013 http://crmkitchen.com/dynamics-crm-2013-developer-toolkit-visual-studio-2013/ http://crmkitchen.com/dynamics-crm-2013-developer-toolkit-visual-studio-2013/#respond Tue, 30 Jun 2015 15:14:50 +0000 http://crmkitchen.com/?p=85   Normally there is no CRM Developer Toolkit installation file for Visual Studio 2013. But you can install it with some customization. Firstly Download the installation files. Open Visual Studio folder and Run Microsoft.CrmDeveloperTools.vsix file Run the crmSDKFix.reg file Copy contents of the CRM MSBuild folder to “C:\Program Files\MSBuild\Microsoft\CRM” or “C:\Program Files (x86)\MSBuild\Microsoft\CRM” If there is no CRM […]

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.

s2

  • Firstly Download the installation files.
  • Open Visual Studio folder and Run Microsoft.CrmDeveloperTools.vsix file
  • s3
  • Run the crmSDKFix.reg file
  • Copy contents of the CRM MSBuild folder to “C:\Program Files\MSBuild\Microsoft\CRM” or “C:\Program Files (x86)\MSBuild\Microsoft\CRM”
  • If there is no CRM folder in MSBuild folder, you can create this CRM folder.
  • Now open Visual Studio and you can create CRM Toolkit Project.

The post Dynamics CRM 2013 Developer Toolkit for Visual Studio 2013 appeared first on CRM Kitchen.

]]>
http://crmkitchen.com/dynamics-crm-2013-developer-toolkit-visual-studio-2013/feed/ 0
(Resolved) CRM Explorer not showing up on Visual Studio http://crmkitchen.com/resolved-crm-explorer-not-showing-visual-studio/ http://crmkitchen.com/resolved-crm-explorer-not-showing-visual-studio/#respond Tue, 30 Jun 2015 14:53:09 +0000 http://crmkitchen.com/?p=94 If you cannot find CRM Explorer in the Tools menu, you can fix the issue like that. Close the Visual Studio Project Open the Project’s Solution file (.sln) in a text edior Find the Global section and insert the following code at the beginning of the section. [crayon-586840ea4a5af527988634/] Save the file and open your project […]

The post (Resolved) CRM Explorer not showing up on Visual Studio appeared first on CRM Kitchen.

]]>
s1
If you cannot find CRM Explorer in the Tools menu, you can fix the issue like that.

  • Close the Visual Studio Project
  • Open the Project’s Solution file (.sln) in a text edior
  • Find the Global section and insert the following code at the beginning of the section.

GlobalSection(CRMSolutionProperties) = preSolution
        SolutionIsBoundToCRM = True
    EndGlobalSection

  • Save the file and open your project again.
  • Now you can find the CRM Explorer in the Tools Menu or Connect to Dynamics CRM Server dialog will show up automatically.

The post (Resolved) CRM Explorer not showing up on Visual Studio appeared first on CRM Kitchen.

]]>
http://crmkitchen.com/resolved-crm-explorer-not-showing-visual-studio/feed/ 0