I have requirement on Dynamics crm 2015 online:
- I have a lookup and subgrid on a custom entity.
- When the user clicks on the 'search' button, which shows search box, I want that search to be pre-populated with the lookup field value, so to save the user from copy/pasting or typing the lookup value into the search box.
What I have tried so far! I have written a JavaScript in which I tried to catch the event of '+' button on sub grid, using 'addEventListener' on 'gridname_addImageButton' id but the event was not caught. This is quite basic stuff for normal web development, but not happening on dynamics crm.
UPDATE This the HTML of the "+" button that appears on the grid.
<a action="tec|ManyToMany|SubGridStandard|Mscrm.AddExistingRecordFromSubGridAssociated" tabindex="1340"
title="Add record." class="ms-crm-ImageStrip-addButton" style="display: block; cursor: pointer;"
onclick="return false;" id="tec_addImageButton" href="#">
<img class="ms-crm-add-button-icon" title="Add Experlogix Model record." alt="Add record."
id="Tec_addImageButtonImage" src="/_imgs/imagestrips/transparent_spacer.gif?ver=-893257913" />
</a>
And this is the javascript that I tried:
var elem = document.getElementById('tec_addImageButton');
elem.addEventListener('click',myFunc(),false);
What am I missing? Regards, Momi