Hi Crm community,
I have a requirement like this, Based on record selection of activities subgrid, should disable OOB Cancel ribbon button.
If we select activity type task need to disable cancel button and email is selected the button should be enabled.
My code is as below, came to know we can retrieve an array of the selected items and can refer to values like this in the array
function canceldisable(selectedItems)
{
var selectedItem = selectedItems[0];
var code = selectedItem.TypeCode.toString();
if(code == "4212")--task entity typecode
return false;
if(code == "4202")--email entity typecode
return true;
Xrm.Page.data.save();
Xrm.Page.ui.refreshRibbon();
} with selectedControlselecteditemreferences and selectioncountrule crm parameter references
used this custom js function in enable rules of ribbon workbench , with no actions , disable rules enabled,
when the same is published using ribbon workbench, the function is firing once the subgrid is loaded without clicking on any record and getting typecode of undefined null reference, think no array reference is coming to selected items.
Can you please check on this...
*This post is locked for comments
I have the same question (0)

Report
All responses (
Answers (