Ok, so I am new to customizing CRM Dynamic 365 (on prem version). I've downloaded the ribbon workbench and able to add a new button on the "CONTACT" screen. I wrote a simple java script code for the button:
Alert("Hello");
And it works fine. When I click on the button I see a pop up message "Hello".
Thus I went ahead trying to get the "business phone" of the SELECTED ROWS. I've tried so may different code (where I found them using google search) and it is NOT working. Here are some of the code I tried:
var rowData = Xrm.Page.getControl("Contacts").getGrid().getSelectedRows().get(0).getData();
var entity = rowData.getEntity();
var attributes = entity.getAttributes();
alert(attributes.get("telephone1").getValue());
The closest I ever got was using the code from ribbon workbench website itself:
which gives me the first column value and it seems this code only can get the "primary key" value of the subgrid, in the case, the company name. But again, I need all other fields from the grid.
Any body have a working solution?
Thank you in advance!
*This post is locked for comments