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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Error when using condition 'next-x-weeks' or -next-x-days

(0) ShareShare
ReportReport
Posted on by

Hi everyone!

I have this strange error. I'm using this code on my development server with CRM 2016 on premise.

var fetchXml =
			"<fetch version='1.0' aggregate='true' >" +
			"<entity name='serviceappointment' >" +
			"<filter type='and' >" +
			"<condition attribute='scheduledstart' operator='next-x-weeks' value='2' />" +
			"<condition attribute='siteid' operator='eq' value='" + siteIdText + "' />" +
			"</filter>" +
			"<attribute name='scheduleddurationminutes' alias='sumDuration' aggregate='sum' />" +
			"</entity>" +
			"</fetch>";


It works great.

I use the same fetcxhXML on the Dynamics CRM Online 2016 , and it popups an error. If i change the condition to 'this-month' or 'next-month' it works ok. It is having issues with the specific condition .

How can add a condition to check if the fetchxml will return none items ? Is there a way to check this scenario??

Any ideas whats going wrong ? It is very strange.

*This post is locked for comments

I have the same question (0)

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

#3
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans