Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Filter search on subgrid base on lookup field

Posted on by 403

how to filter search in subgrid address based on lookup field end customer?

Thanks,

end-cust.PNG1526.address.PNG

*This post is locked for comments

  • Verified answer
    Nithya Gopinath Profile Picture
    Nithya Gopinath 17,074 on at
    RE: Filter search on subgrid base on lookup field

    Regarding Object ID is a field of the activity entity.

    You should change the FetchXML to that of the address entity based on what criteria you need to filter the address entity depending on the end customer field.

  • Ferdiansah Profile Picture
    Ferdiansah 403 on at
    RE: Filter search on subgrid base on lookup field

    function funName_onload()

    {    

        var grid = document.getElementById('LeadActivity');

        if (grid ==null)

        {

          setTimeout('funName_onload()', 2000);

        }

        else {

              var lookupfield = new Array;

              lookupfield = Xrm.Page.getAttribute("originatingleadid").getValue();

              if (lookupfield != null) {

                 var lookupid = lookupfield[0].id;

                 }        

              else {

                   return;

                   }

             var fetchXml = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>";

             fetchXml += "<entity name='activitypointer'>";

             fetchXml += "<attribute name='regardingobjectid' />";        

             fetchXml += "<filter type='and'>";

             fetchXml += "<condition attribute='regardingobjectid' operator='eq' value='" + lookupid + "' />";

             fetchXml += "</filter>";      

             fetchXml += "</entity>";

             fetchXml += "</fetch>";

             grid.control.SetParameter("fetchXml", fetchXml);

             grid.control.Refresh();

            }

    }

    Can you explain? . What 'regardingobjectid' it?

  • Verified answer
    Nithya Gopinath Profile Picture
    Nithya Gopinath 17,074 on at

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,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans