Hi Mohsin Ali and a33ik ,
Thank you for your time in trying to help me on my issue.
May be I was not clear enough in explaining the issue above so I will try to explain my issue again!!
Actually, I have added a custom button on Queue Item subgrid, when user click on custom button...I am moving the queueitem to another queue and changing the status of the queueitem which I have implemented using Ribbon Workbench and JavaScript and all working fine as expected.
Also I am showing button only when atleast one queueitem is selected from the subgrid by adding Enable Rules.
But, my main issue here is....I want to have this custom button only enabled on Phonecall related queueitems and for other EntityType queueitems(ex: email,task etc.,) either I want to throw an alert message to user saying selected queueitem is not of type 'phonecall' or hide the custom button from the subgrid buttons if the selected queueitem is not of type 'phonecall'. My main problem is identifying the type of selected item....!!
I have tried to retrieve the TYPENAME using below code but I am getting the same type everytime as 'queueitem' whichever queueitem I have selected from the subgrid.
Is it possible in any other way either to hide the button or to know the entitytype based on the selection? Please let me know. Thanks
function run(selectedItems)
{
var selectedItem = selectedItems[0];
alert("Id=" + selectedItem.Id + "\nName=" + selectedItem.Name + "\nTypeCode=" + selectedItem.TypeCode.toString() + "\nTypeName=" + selectedItem.TypeName);
}
Result:
Id = 17D0EF3A-9B72-46E8-AA88-DAA5FC462FA4
Name = Test
TypeCode = 2029
TypeName = queueitem