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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Looking for fetch contacts based on Marketing List Id.

(0) ShareShare
ReportReport
Posted on by 4,601

HI All,

I am facing trouble in fetching contacts list based on marketing list Id. I am not getting relation key between contact and market list entities. Please guide me what key I need to use for query. If you have soap query example that would be great. 

Thanks,

Sandeep

*This post is locked for comments

I have the same question (0)
  • Verified answer
    David Jennaway Profile Picture
    14,065 on at

    You need to go via the listmember entity. Try the following (replacing the Guid of the list):

    <fetch distinct="true" mapping="logical" output-format="xml-platform" version="1.0">
    <entity name="contact">
    <attribute name="fullname"/>
    <attribute name="contactid"/>
    <order descending="false" attribute="fullname"/>
    <link-entity name="listmember" intersect="true" visible="false" to="contactid" from="entityid">
    <link-entity name="list" to="listid" from="listid" alias="ag">
    <filter type="and">
    <condition attribute="listid" value="{3AB71ACC-1932-E611-80D2-000D3A20C1B1}" operator="eq"/>
    </filter>
    </link-entity>
    </link-entity>
    </entity>
    </fetch>


  • Rickard Norström Profile Picture
    on at

    Hi,

    I also think that you can only do this for static lists, correct me if I'm wrong here David.

    Regards

  • sandeepstw Profile Picture
    4,601 on at

    Is it not include any soap body?

  • Verified answer
    Community Member Profile Picture
    on at

    Rickard Nordström is partly correct. To fetch members directly only work with static list. Otherwise, you must fetch the fetchxml contained in the dynamic list (I think under an attribute called query) and call that one to retrieve the contacts. So it's possible with dynamic lists as well, but in a different way.

    To simplify the execution of the query, you can use the xrm toolkit. Read more here arunpotti.wordpress.com/.../retrieve-records-using-fetch-xml-java-script-in-crm-201113

  • Verified answer
    sandeepstw Profile Picture
    4,601 on at

    I am using PHP code to fetch records, I can't use js for this. Please guide me if any link for making soap request for the query.

  • Verified answer
    Robert Wittig Profile Picture
    1,885 on at

    If you can write C# there is a great tool that will take an individual service request and turn it into a SOAP request.  The tool is included in the SDK it is included in the SDK here SDK\SampleCode\CS\Client\SOAPLogger.

    Here is a nice guide on how to use the tool www.powerobjects.com/.../microsoft-dynamics-crm-soap-logger-a-tool-that-can-greatly-simplify-writing-http-requests

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans