I am looking to use the look up's search in a web resource and maintain all its functionality. I do not need it to search anything I have the code for that I just want the styles and other functionality.
*This post is locked for comments
I am looking to use the look up's search in a web resource and maintain all its functionality. I do not need it to search anything I have the code for that I just want the styles and other functionality.
*This post is locked for comments
As Alex said this is not really supported, but if you still want to do this and build the web resource, you can add a control by adding the following code (sample is for User entity lookup):
Lookup Control:
<table width="100%" style="table-layout: fixed;" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<table class="ms-crm-Lookup" id="crmOtherLookup_lookupTable" style="width: 100%; table-layout: fixed;" cellspacing="0" cellpadding="0" lookupid="crmOtherLookup">
<tbody><tr><td valign="top" style="padding-right: 1px; padding-left: 1px;">
<div tabindex="0" class="ms-crm-Lookup ms-crm-ReadOnly ms-crm-Lookup-ReadOnly" role="list" style="width: 100%;" ime-mode="auto">
<!-- <ul style="width: 100%; text-align: left; float: left;"></ul> -->
<input type="hidden" id="crmOtherLookup_lId" />
</div>
<!-- <label class="ms-crm-Hidden-NoBehavior" for="crmOwnerLookup_ledit">Assign the selected Comment to the following user or team:</label> -->
<input disabled="disabled" tabindex="0" class="ms-crm-Hidden-NoBehavior" id="crmOtherLookup_ledit" style="padding: 2px 0px 1px; height: 100%; border-right-color: currentColor; border-right-width: 0px; border-right-style: none; display: inline;" type="text" maxlength="1000" ime-mode="auto"></td>
<td class="Lookup_RenderButton_td" style="width: 21px;">
<img title="Click to select a value for Routing the selected Comment to the following user:" class="ms-crm-Lookup ms-crm-ImageStrip-btn_dis_lookup" id="crmOtherLookup" style="cursor: default;" alt="Click to select a value to Router the selected Comment to the following user:" src="/_imgs/btn_dis_lookup.png" forcesubmit="false" isenableinlinelookupforeditforms="1" lookupstyle="single" lookuptypes="8" lookuptypenames="systemuser:8:User" lookuptypeicons="/_imgs/ico_16_8.gif?ver=-889823255" onclick="openOther();">
<a tabindex="-1" title="Click to select a value for Routing the selected Comment to the following user" onclick="openOther();" href="#"></a>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
JQuery functions to get the values from lookup:
function getLookupValue(lookupName)
{
var lookupName = "#" + lookupName;
var otherId = $(lookupName + "_lId").val();
var otherName = $(lookupName + "_ledit").val();
}
function disableLookup(lookupName)
{
lookupName = "#" + lookupName;
$(lookupName).attr("src", "/_imgs/btn_dis_lookup.png");
$(lookupName).css("cursor", "default");
$(lookupName).removeClass("ms-crm-ImageStrip-btn_off_lookup");
$(lookupName).addClass("ms-crm-ImageStrip-btn_dis_lookup");
}
function enableLookup(lookupName)
{
lookupName = "#" + lookupName;
$(lookupName).attr("src", "/_imgs/btn_off_lookup.png");
$(lookupName).css("cursor", "pointer");
$(lookupName).removeClass("ms-crm-ImageStrip-btn_dis_lookup");
$(lookupName).addClass("ms-crm-ImageStrip-btn_off_lookup");
}
Yeah I can use the inspector to bring over all the styles its really just the clear functionality and the help text not disappearing. I really did not want to have to re code the js they use.
Hi,
you can't re-use Dynamics controls in the web resources - you have to develop your own from scratch. Or you have to find a way to make do with the less advanced web resources.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,235 Most Valuable Professional
nmaenpaa 101,156