Dynamics CRM: Odata query that checks if the file attachment file name contains the unicode '#'

吃可爱长大的小学妹 提交于 2019-12-12 03:59:37

问题


Scenario: I have a custom entity with attachments in Dynamics CRM 2011. I want to query those attachments with file name that contains a hash tag ('#'). Say I have attached a few text documents. kdk#ie.txt, Report.txt, & k!ke.txt to the custom entity. Here are my results to my Odata query. Error Code:

//ORGANIATION/XRMServices/2011/OrganizationData.svc/AnnotationSet?$filter=ObjectId/Id eq guid'{GUID HERE}' and IsDocument eq true and substringof('#',FileName)

Return: Bad Request

Because it is a unicode I tried the following on the string parameter. '\u0023' 'U+0021' 'w%u0023'

But return is either 0 or Bad Request

I tested '!' & 'Report' it was successful return 1 respectively. It seem it only does not work for the #.

Any ideas why I am not getting the result I expected?

Really appreciate it.

TIA


回答1:


"#" sign is a special character in a URL. It has to be encoded to not create an invalid URL. msdn.microsoft.com/en-us/library/aa226544(SQL.80).aspx



来源:https://stackoverflow.com/questions/33138561/dynamics-crm-odata-query-that-checks-if-the-file-attachment-file-name-contains

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!