Hi Guys,
I am looking fetch contacts modified in last 2 days using soap query.
Thanks,
Sandeep
*This post is locked for comments
Hi Guys,
I am looking fetch contacts modified in last 2 days using soap query.
Thanks,
Sandeep
*This post is locked for comments
Your query will look like this:
function lastdaysmodifiedon(){ var date = new Date(); date.setDate(date.getDate()-2); var dateFilter = getODataUTCDateFilter(date); "/xrmservices/2011/OrganizationData.svc/ContactSet?$select=FullName,ModifiedOn&$filter=ModifiedOn ge" + dateFilter +"'"; } function getODataUTCDateFilter(date) { var monthString; var rawMonth = (date.getUTCMonth() + 1).toString(); if (rawMonth.length == 1) { monthString = "0" + rawMonth; } else { monthString = rawMonth; } var dateString; var rawDate = date.getUTCDate().toString(); if (rawDate.length == 1) { dateString = "0" + rawDate; } else { dateString = rawDate; } var hourString = date.getUTCHours().toString(); if (hourString.length == 1) hourString = "0" + hourString; var minuteString = date.getUTCMinutes().toString(); if (minuteString.length == 1) minuteString = "0" + minuteString; var secondString = date.getUTCSeconds().toString(); if (secondString.length == 1) secondString = "0" + secondString; var DateFilter = "datetime'"; DateFilter += date.getUTCFullYear() + "-"; DateFilter += monthString + "-"; DateFilter += dateString; DateFilter += "T" + hourString + ":"; DateFilter += minuteString + ":"; DateFilter += secondString + "Z'"; return DateFilter; }
That's definitely correct. If you have more than 5000 records you will have to use paging to get all records:
It returns 5000 records, I don't think that right.
Sandeep,
Following FetchXml query should resolve your requirement:
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="contact">
<attribute name="fullname" />
<attribute name="telephone1" />
<attribute name="contactid" />
<filter type="and">
<condition attribute="modifiedon" operator="last-x-days" value="2" />
</filter>
</entity>
</fetch>
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156