Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

doesn't Xrm.Webapi support custom fields?!

Posted on by 1,010

why do I get this:

Default Price List: Could not find a property named 'new_worldterritoryid' on type 'Microsoft.Dynamics.CRM.account'.

...from this:

    this.determineDefaultPxLst = function (ExecutionContext, accountid) {
        formContext = ExecutionContext.getFormContext();
        Xrm.WebApi.retrieveRecord("account", accountid, "?$select=name&$expand=new_worldterritoryid($select=_new_defaultpricelevelid_value)").then(

And, yes, it's there.  Has been for months.

*This post is locked for comments

  • Martin Donnelly Profile Picture
    Martin Donnelly 1,010 on at
    RE: doesn't Xrm.Webapi support custom fields?!

    Yes, I recalled this from the SOAP days and decided to give it a try.

  • Verified answer
    MSCRM Guru Profile Picture
    MSCRM Guru 600 on at
    RE: doesn't Xrm.Webapi support custom fields?!

    Hi mardukes,

    I've found in the past that the WebAPI can be case sensitive for entity and attribute names - really depends on the specific version you are working with.  Basically if the schema name of your attribute is new_WorldTerritoryId, new_WorldTerritoryid, new_WorldterritoryId, etc. it wont work as expected.

    Try copy\pasting the attribute schema name from the solution.

    Hope that makes sense and resolves it.

    Good luck!

  • Suggested answer
    Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: doesn't Xrm.Webapi support custom fields?!

    There shouldn't be any reason why you can't find your property.

    Try using CRM Rest Builder (version 2.6) and generate you WebApi function call.

    This will show you what is missing.

    Hope this helps.

  • Kokulan Profile Picture
    Kokulan 18,048 on at
    RE: doesn't Xrm.Webapi support custom fields?!

    If you would like to explore this further to see why the FETCH did not work, please share the code

  • Martin Donnelly Profile Picture
    Martin Donnelly 1,010 on at
    RE: doesn't Xrm.Webapi support custom fields?!

    Can't explain why the fetchXML doesn't work but discovered the web api query string requires schema name, new_WorldTerritoryId.

  • Martin Donnelly Profile Picture
    Martin Donnelly 1,010 on at
    RE: doesn't Xrm.Webapi support custom fields?!

    ...and now I've tried Xrm.WebApi.retrieveMultipleRecords(... with fetchXML and it won't come out.  The same fetch that works with advanced find and fetch tester yields a count of 1 but no worldterritoryid.

    I give up.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans