简体   繁体   中英

Odata filter query in PowerShell for Dynamics 365

Trying to use a filter on a oData query for D365 F&O data entity however can't seem to get it to work. I get results without filter however what i'm trying to do is use a EQ operator to filter based on a string value. I've tried double quotes, single quotes but none seem to work. Below is the specific line from my PowerShell script.

Get-D365ODataEntityData -EntityName SecurityUserRoleAssociations-Token $token -ODataQuery '$filter=UserID eq "ABC"' 

Please let me know if anyone has any suggestions. Thanks

根据文档-ODataQuery应该是'$filter=UserID eq ''ABC'''

Get-D365ODataEntityData -EntityName SecurityUserRoleAssociations-Token $token -ODataQuery '$filter=UserID eq ''ABC''' 

In addition to the below answer about escaping single quotes, the filter is case sensitive and should be UserId.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM