Tuesday, August 16, 2011

how to get the selected records' guid in a grid in ms crm 2011

some times we need to put ISV buttons(in 2011 its buttons in ribbons,tabs), onclick of which we can get the selcted records for som other purpose.
to get the list of selected records' guid follow the following

include the following in the ribbon.xml file of the entity

<Actions>
<JavaScriptFunction FunctionName="Mscrm_Isv_new_entity_SubGrid_Group0_Control0_5" Library="$Webresource:new_entity_ribbon.js" >
<CrmParameter Value="SelectedControlSelectedItemIds" />
</JavaScriptFunction>
</Actions>

then in the new_entity_ribbon.js file write the function

function Mscrm_Isv_new_tmtasklist_SubGrid_Group0_Control0_5(SelectedControlSelectedItemIds){
alert("SelectedControlSelectedItemIds"+SelectedControlSelectedItemIds);//this will get the GUIDs, separated by comma
}


 
hope this will help...

No comments:

Post a Comment