Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

Getting Business phone number from Contact Subgrid

$
0
0

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:

https://ribbonworkbench.uservoice.com/knowledgebase/articles/129783-pass-the-currently-selected-grid-row-s-to-a-custo

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!


Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images