Hi
how to write fetch xml query to retrieve data with specific future date
ex. select * contact where expirydate = Getdate()+40;
Hi
how to write fetch xml query to retrieve data with specific future date
ex. select * contact where expirydate = Getdate()+40;
i mean is there any direct way to add getDate() + 40 in the fetch xml query
Did you mean something like this?
C#:
DateTime today = DateTime.Now; // Replace with CRM Attribute Value
DateTime expiredate = today.AddDays(40);
var fetchXml = $@"
<fetch top='50'>
<entity name='contact'>
<all-attributes />
<filter type='and'>
<condition attribute='ilume_testrollup_date' operator='eq' value='{expiredate}'/>
</filter>
</entity>
</fetch>";
Javascript:
var expiredate = new Date(); Insert CRM Attribute Value
expiredate.setDate(d.getDate() + 40);
var fetchXml = [
"<fetch top='50'>",
" <entity name='contact'>",
" <all-attributes />",
" <filter type='and'>",
" <condition attribute='ilume_testrollup_date' operator='eq' value='", expiredate, "'/>",
" </filter>",
" </entity>",
"</fetch>",
].join("");
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