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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Retrieve a record from msdyn_customerasset based on custom field

(0) ShareShare
ReportReport
Posted on by 30

Hi,

We have added a custom field "ipaddress" in entity msdyn_customerasset.

I'm trying to retrieve a record using-

{{url}}/api/data/v9.0/msdyn_customerassets(ipaddress='10.10.10.10')

But this gives me following error-

{
    "error": {
        "code": "0x8006088a",
        "message": "Bad Request - Error in query syntax.",
        "innererror": {
            "message": "Bad Request - Error in query syntax.",
            "type": "Microsoft.OData.ODataException",
            "stacktrace": "   at Microsoft.OData.UriParser.ODataUriResolver.ResolveKeys(IEdmEntityType type, IDictionary`2 namedValues, Func`3 convertFunc)\r\n   at Microsoft.OData.UriParser.AlternateKeysODataUriResolver.ResolveKeys(IEdmEntityType type, IDictionary`2 namedValues, Func`3 convertFunc)\r\n   at Microsoft.OData.UriParser.SegmentArgumentParser.TryConvertValues(IEdmEntityType targetEntityType, IEnumerable`1& keyPairs, ODataUriResolver resolver)\r\n   at Microsoft.OData.UriParser.SegmentKeyHandler.CreateKeySegment(ODataPathSegment segment, KeySegment previousKeySegment, SegmentArgumentParser key, ODataUriResolver resolver)\r\n   at Microsoft.OData.UriParser.SegmentKeyHandler.TryCreateKeySegmentFromParentheses(ODataPathSegment previous, KeySegment previousKeySegment, String parenthesisExpression, ODataUriResolver resolver, ODataPathSegment& keySegment, Boolean enableUriTemplateParsing)\r\n   at Microsoft.OData.UriParser.ODataPathParser.TryBindKeyFromParentheses(String parenthesesSection)\r\n   at Microsoft.OData.UriParser.ODataPathParser.TryCreateSegmentForNavigationSource(String identifier, String parenthesisExpression)\r\n   at Microsoft.OData.UriParser.ODataPathParser.CreateFirstSegment(String segmentText)\r\n   at Microsoft.OData.UriParser.ODataPathParser.ParsePath(ICollection`1 segments)\r\n   at Microsoft.OData.UriParser.ODataPathFactory.BindPath(ICollection`1 segments, ODataUriParserConfiguration configuration)\r\n   at Microsoft.OData.UriParser.ODataUriParser.Initialize()\r\n   at System.Web.OData.Routing.DefaultODataPathHandler.Parse(String serviceRoot, String odataPath, IServiceProvider requestContainer, Boolean template)\r\n   at System.Web.OData.Routing.DefaultODataPathHandler.Parse(String serviceRoot, String odataPath, IServiceProvider requestContainer)\r\n   at Microsoft.Crm.Extensibility.ODataV4.Routing.CrmODataPathHandler.Parse(String serviceRoot, String odataPath, IServiceProvider requestContainer)"
        }
    }
}


*This post is locked for comments

I have the same question (0)
  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi

    I think this is the correct syntax of retrieving the field value using Web API. Try below:

    crmorgname.crm6.dynamics.com/.../msdyn_customerassets$select=msdyn_name&$filter=new_ipaddress eq '10.10.10.10'

    I would also suggest you to use CRM Rest Builder tool to build the WEB API request. This is the easiest way to build the query as well as execute it and see the results.

    carldesouza.com/dynamics-crm-rest-builder

    You can download the tool here- github.com/.../releases

    Hope this helps.

  • RaviKashyap Profile Picture
    55,410 Moderator on at

    Sorry the correct URL: {URL}/api/data/v8.2/msdyn_customerassets?$select=msdyn_name&$filter=new_ipaddress%20eq%20%2710.10.10.10%27

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans