Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

How to retrieve leads from Microsoft Dynamics CRM with PHP

Posted on by Microsoft Employee

Hi..

Please help me to retrieve leads from Microsoft Dynamics CRM.

i am using PHP Soap XML for retrieving.

Can any one give me the full code for retrieving leads with PHP.

i already spend a lot of time with this. please help......

*This post is locked for comments

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: How to retrieve leads from Microsoft Dynamics CRM with PHP

    After you will start using that tool you will have to write query that you want to run in C#, run the tool and get Xml as an output. That's what written in article.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to retrieve leads from Microsoft Dynamics CRM with PHP

    Oh!!

    I will try to arrange a windows system and Visual studio.

    after installing this tool we can build our own XML for retrieving leads..? that created XML i can place in my PHP code right ..?

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: How to retrieve leads from Microsoft Dynamics CRM with PHP

    No. This tool requires Windows and Visual Studio. Welcome to our wonderful world ;)

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to retrieve leads from Microsoft Dynamics CRM with PHP

    Hi,

    I am using Linux system is it possible to install this tool in linux.?

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: How to retrieve leads from Microsoft Dynamics CRM with PHP

    To get valid Xml you can use SoapLogger - www.powerobjects.com/.../microsoft-dynamics-crm-soap-logger-a-tool-that-can-greatly-simplify-writing-http-requests

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to retrieve leads from Microsoft Dynamics CRM with PHP

    Hi Joe,

    Thanks for your replay....

    But i already tested this example its working fine. But it retrieves the systemuser info ( please see the xml parameter  <a:LogicalName>systemuser</a:LogicalName> ). But instead of this i need to fetch the leads. for this i changed the XML structure but its not working for me.

    Please see the XML for fetching systemuser

    $xml = "<s:Body>";
    $xml .= "<Execute xmlns=\"schemas.microsoft.com/.../Services\" xmlns:i=\"www.w3.org/.../XMLSchema-instance\">";
    $xml .= "<request i:type=\"a:RetrieveRequest\" xmlns:a=\"schemas.microsoft.com/.../Contracts\">";
    $xml .= "<a:Parameters xmlns:b=\"schemas.datacontract.org/.../System.Collections.Generic\">";
    $xml .= "<a:KeyValuePairOfstringanyType>";
    $xml .= "<b:key>Target</b:key>";
    $xml .= "<b:value i:type=\"a:EntityReference\">";
    $xml .= "<a:Id>" . $id . "</a:Id>";
    $xml .= "<a:LogicalName>systemuser</a:LogicalName>";
    $xml .= "<a:Name i:nil=\"true\" />";
    $xml .= "</b:value>";
    $xml .= "</a:KeyValuePairOfstringanyType>";
    $xml .= "<a:KeyValuePairOfstringanyType>";
    $xml .= "<b:key>ColumnSet</b:key>";
    $xml .= "<b:value i:type=\"a:ColumnSet\">";
    $xml .= "<a:AllColumns>false</a:AllColumns>";
    $xml .= "<a:Columns xmlns:c=\"schemas.microsoft.com/.../Arrays\">";
    $xml .= "<c:string>firstname</c:string>";
    $xml .= "<c:string>lastname</c:string>";
    $xml .= "</a:Columns>";
    $xml .= "</b:value>";
    $xml .= "</a:KeyValuePairOfstringanyType>";
    $xml .= "</a:Parameters>";
    $xml .= "<a:RequestId i:nil=\"true\" />";
    $xml .= "<a:RequestName>Retrieve</a:RequestName>";
    $xml .= "</request>";
    $xml .= "</Execute>";
    $xml .= "</s:Body>";

    Instead of this XML request i needed the Lead retrieve XML,  for retrieving lead the LogicalName may be Lead and so on....
    But some other changes need to be done in the above XML format for retrieving Leads.

    Can you please give me the XML format for retrieving Lads.

    Its a big deal for me.. i also spend a lot of time for this.. please...

  • Suggested answer
    Joe Gill Profile Picture
    Joe Gill on at
    RE: How to retrieve leads from Microsoft Dynamics CRM with PHP

    Good starting point jlattimer.blogspot.ie/.../PHP

    Joe

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