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 :
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

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 > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans