RetrieveMultiple performance on large datasets


Using TPL in CRM

Natraj Yegnaraman's avatarDreaming in CRM & Power Platform

EDIT (21/05/15): After DMing with @maustinjones, I have added stat for paged RetrieveMultiple as well. I have updated the post to include this.

EDIT (22/05/15): Updated post to reflect correct behaviour of no-lock when parallelising. Thanks @maustinjones. Please also refer to the follow up post -> http://dreamingincrm.com/2015/05/22/redux-retrievemultiple-on-large-datasets/ on why paging cookie, is the recommended approach.

MSCRM limits the maximum result size to 5000 records, when you use the RetrieveMultiple request. In order to overcome this and retrieve all the records, you’ll have to use paging. PFEDynamics team have also released an open-source library called PFE Xrm Core Library that utilises Task Parallel Library.

There is also ExecuteMultipleRequest that you can use to send bunch of requests in one go, and process the responses. This just wanted to document by findings, about the performance of these options:

  1. Just using Parallel.ForEach
  2. ExecuteMultipleRequest
  3. PFE Xrm Core
  4. Paged RetrieveMultiple

Run 1 (Batch…

View original post 529 more words

Sample code to close a quote as won using WinQuoteRequest in CRM 2016 (and earlier)


Just sharing a sample code to close quote as won through C#


WinQuoteRequest winQuoteRequest = new WinQuoteRequest();
Entity quoteClose = new Entity("quoteclose");
quoteClose.Attributes["quoteid"] = new EntityReference("quote", new Guid("015816C2-2F10-E611-8112-3863BB353ED0"));
quoteClose.Attributes["subject"] = "Quote Close" + DateTime.Now.ToString();
winQuoteRequest.QuoteClose = quoteClose;
winQuoteRequest.Status = new OptionSetValue(-1);
organizationProxy.Execute(winQuoteRequest);

Hope it helps..

Writing Scripts for SubGrids with CRM 2015 Update 1


anilambadan's avatarcrmcooking

With the release of CRM 2015 Update 1 we can write supported scripts to get information from the subgrids.

Before CRM Online 2015 Update 1 the only unique method for the subgrid control was refresh.

As an Xrm.Page.ui control, GridControl also has all the standard control methods: getControlType, Label methods, getParent,Visible methods, setFocus, and Notification methods as well as refresh

OnLoad event

Add event handlers to this event to run every time the subgrid refreshes. This includes when users sort the values by clicking the column headings. Use the GridControl.addOnLoad and GridControl.removeOnLoad methods to manage event handlers, usually in the form Onload event.

Example :

Xrm.Page.getControl("Contacts").addOnLoad(<functionname>);

getEntityName

Use this method to get the logical name of the entity data displayed in the grid.

getGrid

Use this method to get access to the Grid available in the GridControl.

getViewSelector

Returns the

View original post 203 more words

Set PartyList field To in Email in CRM 2015 (and earlier)


Sample code to set the PartyList field for Email Activity.


function setContact() {

var partlistData = new Array();
partlistData[0] = new Object();

// guid of the record
partlistData[0].id = "8B2AD82B-30D6-E511-811F-3863BB356F90";

// name of the record
partlistData[0].name = "Hugh Grant";

// entity schema name
partlistData[0].entityType = "contact";
Xrm.Page.getAttribute("to").setValue(partlistData)

}

Hope it helps..

The selected translations file is either invalid or does not conform to the required translations file schema error while importing translations in CRM 2015 (and earlier)


Hi,

While importing translations we got the below error

On opening the CrmTranslations.xml we saw the translations missing for that row.

On specifying the values for those fields and importing it back fixed the issue.

Hope it helps..

Plugin on update of Quote Detail in CRM 2015 firing on Quote Create Issue.


Hi,

We were facing one issue recently on creating Quote, where in we were getting exception on our Plugin that was registered in Post Update of Quote Detail.

It was kind of surprise for us that why it was getting triggered.

We removed all our others plugin and workflow on Quote and Quote Line but still that plugin was getting triggered. So we thought of trying it out on Vanilla instance of CRM 2016. In case of CRM 2016 the plugin registered on Post Update of Quote Detail didn’t trigger.

We then tried it on Vanilla instance of CRM 2015 On Premise (no online available), and we saw the same case i.e. Plugin getting triggered.

We were getting the following detail on Context.ParentContext (in case where Plugin on Update of Post Quote Detail is asynchronous)

                     Message – Update

         Stage – 30

         EntityReference (Target) – Quote

For Synchronous the message will be Retrieve

Hope it helps..