Showing posts with label UnSupported. Show all posts
Showing posts with label UnSupported. Show all posts

Saturday, 14 November 2015

This workflow job was canceled because the workflow that started it included an infinite loop.

Hi,
 
In CRM, Workflow is one of the amazing things. If our workflow calls itself (on the same entity) more than 7 times in an hour, the 8th instance will fail with the below error.
 
"The error is triggered because, by default, CRM only allows for up to eight nested child workflows. When you attempt to run more, CRM will recognize it as an infinite loop and throw error message."
 
CRM has a limit for this depth. This can seen in MSCRM_Config database by executing the following query.

SELECT * FROM
       DEPLOYMENTPROPERTIES
WHERE
       COLUMNNAME = 'MessageProcessorMaximumDepth'

If we have really strong requirement that workflow should be called more than 8 times then we can update the value in the Database using the following update query.
 
UPDATE DEPLOYMENTPROPERTIES
SET INTCOLUMN = <Number>
WHERE COLUMNNAME = 'MessageProcessorMaximumDepth'

After updating, make sure you reset IIS so that new value will be considered by CRM. 

Note: This is unsupported, it may cause issue when you upgrade the CRM system to newer versions.
 
Hope this helps.
 
--
Happy CRM'ing

Gopinath 

Saturday, 17 October 2015

Get the Selected Record Id of Subgrid in CRM 2013/ 2015 - UnSupported

Hi,

At times in CRM, we need to go for unsupported things to fulfill customer requirements. In CRM 2011, we used to get the selected record id of the sub gird in the JavaScript method in a supported way. But in CRM 2013 and 2015 on premise versions we don't have feature available.

Here is the unsupported JavaScript to get the selected record id.

function GetSelectedRecordId() {
    // Grid Control Object
    var objGrid = document.getElementById("opportunityproductsGrid").control;
    // Get Selected Ids.
    var vSelectedIds = objGrid.get_selectedIds();
    if (vSelectedIds.length == 0) {
        alert("No record is selected.");
        return;
    }
    else if (vSelectedIds.length > 1) {
        alert("Please select only one record and click this button.");
        return;
    }
    else {
        // Your logic.
    }
    //All records record id in the sub grid
    // objGrid.get_allRecordIds();
}

Hope this helps.

--
Happy CRM'ing
Gopinath