Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

I am looking to use the look up search field in a web resource.

Posted on by 200

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.

166213.Capture.PNG

*This post is locked for comments

  • Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: I am looking to use the look up search field in a web resource.

    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");

    }

  • whatup Profile Picture
    whatup 200 on at
    RE: I am looking to use the look up search field in a web resource.

    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.

  • ashlega Profile Picture
    ashlega 34,475 on at
    RE: I am looking to use the look up search field in a web resource.

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans