web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Unanswered

How to get control of the lookup modal jQuery

(0) ShareShare
ReportReport
Posted on by 195

Hi,

Want to get control of the look up modal and the body using JQuery.

Please help me with this!!!

pastedimage1594393584612v1.png

Regards,

Susritha.

I have the same question (0)
  • LeoAlt Profile Picture
    16,331 Moderator on at

    Hi Partner,

    Could you kindly share more details about your requirement, why you need to get the lookup field by Jquery when opening the modal?

    As we know we need to use $("#fieldname) to get field in portal form, and even though you opened the lookup modal, you could also get the lookup filed by this code.

    pastedimage1594603971985v1.png

    And if you want to do actions on the lookup modal, you could find its ID or  class name by F12 developer tools.

    pastedimage1594604030879v2.png

    Best Regards,

    Leo

  • Susritha Profile Picture
    195 on at

    The required is to add records to the lookup modal based on the odata Query.

    When I was trying with the Custom modal then I can able to get control of it and I can add records to the modal.

    $('#myModal').find('.modal-body .table tbody').append('<tr data-id="' + data.value[i].knowledgearticleid + '" data-entity="knowledgearticle" data-name="' + data.value[i].title + '><td data-th="Select" aria-label="Select " tabindex="0" role="checkbox"> <span class="fa fa-fw"></span></td><td data-type="System.String" data-attribute="title" data-value="' + data.value[i].title + '" tabindex = "0" data-th="Title" aria-label="' + data.value[i].title + '" > ' + data.value[i].title + '</td ></tr>');

    pastedimage1594610864047v1.png

    but not for the lookup modal in Entity form.

    Please help me with this!!!

  • LeoAlt Profile Picture
    16,331 Moderator on at

    Hi partner,

    Thanks for your details.

    The modal in portal form could be found by $("table[role$='grid']") under its Div.

    pastedimage1594629184549v1.png

    pastedimage1594629209338v2.png

    And then you need to add your custom data into the table by its format.

    pastedimage1594629259665v3.png

    Best Regards,

    Leo

  • Susritha Profile Picture
    195 on at

    Can you give more details  about $("table[role$='grid']") ) under its Div.

  • LeoAlt Profile Picture
    16,331 Moderator on at

    Hi Partner,

    You could get it in your own environment by Jquery code and find more details.

    In my case, there are 3 girds in my form so I will found 3 elements by $("table[role$='grid']") ), that is the reason we need to find the gird under the special DIV.

    pastedimage1594693512030v1.png

    After you get the table element, you could add tr and td in it to add your custom records.

    Regards,

    Leo

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 49 Super User 2025 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 27 Most Valuable Professional

#3
Soundari Profile Picture

Soundari 15

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans