无效的Uri:Uri方案太长。 UriFormatException”;在Dynamics-CRM FetchXML中 [英] Invalid Uri: The Uri scheme is too long. UriFormatException" In dynamics-CRM FetchXML
问题描述
我正在尝试使用 FetchXML获取请求查询 Dynamic-CRM 系统。
错误:
无效的Uri:Uri方案太长。UriFormatException 当我使用特定的属性过滤器时,会发生
。
例如:
当尝试通过 on-or-after运算符引用带时间戳的dateTime来使用过滤条件时。我得到:
I'm trying to query a Dynamic-CRM system using FetchXML get request. The error: "Invalid Uri: The Uri scheme is too long. UriFormatException" occurs when I'm using specific attributtes\filters. For example: When trying to use filter condition with "on-or-after" operator referring dateTime with time stamp. I'm getting:
初始查询很大并且可以正常工作,但是当我缩短查询并使用特定属性时,错误就会出现。我没办法解决这个问题。
参见我的代码,例如:
这不起作用:
The initial query is big and working, but event when I shorten the query and use a specific attribute, the error raise. I couldn't put my finger on the problem. See my code, as example: This is not working:
<filter>
<condition attribute="scheduledend" operator="le" value="2020-03-16T10:23:30" />
</filter>
这是可行的,但没有时间戳:
This is working, but witout time stamp:
<filter>
<condition attribute="scheduledend" operator="on-or-before" value="03/16/2020" />
</filter>
让我强调一下-
<filter>
<condition attribute="scheduledend" operator="le" value="2020-03-16T10:23:30" />
</filter>
如果删除某些查询属性或过滤器,则可能会起作用-因此,这是只是一个例子-我找不到工作模式-不工作。
可能是此问题的根本原因?
might work if I remove some query attributes or filters - so this is just an example - I couldn't find a pattern for working\not working. What might be the root cause for this problem ?
推荐答案
令我惊讶的是,由于冒号:
是正常部分如果是HTTP URI,则时间戳中的冒号可能会触发该问题。
根据标准URL编码,:
编码为%3A
。
It strikes me that since the colon :
is a normal part of an HTTP URI, the colons in the timestamp may be triggering the issue.
According to the standard URL encoding, :
encodes to %3A
.
Maybe give that a shot.
另一个注意事项是,单引号是合法的URL字符,而双引号是不安全,因此可以在FetchXML内切换到单引号:
Another consideration is that a single quote is a legal URL character but a double quote is unsafe, so maybe switch to single quotes inside the FetchXML:
< condition attribute ='scheduledend'运算符='le'value ='2020-03-16T10%3A23%3A30'/>
这篇关于无效的Uri:Uri方案太长。 UriFormatException”;在Dynamics-CRM FetchXML中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!