Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Answered

?$expand= not working in API using GET statement in postman

Posted on by 26
Hi Everyone,
I am using the standard Customer API and trying to expand the customerFinancialDetail using ?$expand. But getting an error as below.In webservices , page is published and using the Oauth link in postman.We get the below error in postman.
 "error": {
        "code": "BadRequest",
        "message": "Could not find a property named 'customerFinancialDetail' on type 'NAV.Customer'.  CorrelationId:  71406eae-2fb0-48fa-a274-cddfbab13b5b."
    }
 
Please find the URL 
 
 
get the above error.
"error": {
        "code": "BadRequest",
        "message": "Could not find a property named 'customerFinancialDetail' on type 'NAV.Customer'.  CorrelationId:  71406eae-2fb0-48fa-a274-cddfbab13b5b."
    }
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 63,922 Super User on at
    ?$expand= not working in API using GET statement in postman
    Hi, Unfortunately, this is not possible as of now. This is mentioned in several Microsoft documents.
    More details:
    Image
    This page type can't be extended by creating a page extension object. Instead, you must create a new API by adding a page object.
     
    Thanks.
    ZHU
  • BK-24061057-0 Profile Picture
    BK-24061057-0 26 on at
    ?$expand= not working in API using GET statement in postman
    Hi Yun Zhu,
     
    So to this standard API is it possible to add any new fields or any customized fields. If not what is the option to do so. Means how to create a sales order in a single API ( Header and lines) with new custom fields \ new standard fields.
     
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 63,922 Super User on at
    ?$expand= not working in API using GET statement in postman
    Hi, hope the following helps.
    API page type
     
    Here are a few examples, I hope they can give you some reference.
    Dynamics 365 Business Central: How to use Standard/Custom API Bound Actions
    Dynamics 365 Business Central: Release a Sales Order with Power Automate
    Dynamics 365 Business Central: How to post document/journal via Power Automate
     
     
    Thanks
    ZHU
  • BK-24061057-0 Profile Picture
    BK-24061057-0 26 on at
    ?$expand= not working in API using GET statement in postman
    Hi Mohana\ Yun Zhu ..
    Thanks for the update. Is there any link which you can share for API where the same can be achieved for customized pages.
  • Verified answer
    YUN ZHU Profile Picture
    YUN ZHU 63,922 Super User on at
    ?$expand= not working in API using GET statement in postman
    As Mohana mentioned, ?$expand= cannot be done with Web Services, my example uses the standard API.
    For salesInvoice resource type:
     
    https://api.businesscentral.dynamics.com/v2.0/c8558e71-6ad8-4fcd-9f29-3ca165b41bbe/Sandbox242/api/v2.0/companies(2c6ea79a-9223-ef11-8414-6045bdc8cdaf)/salesInvoices
  • BK-24061057-0 Profile Picture
    BK-24061057-0 26 on at
    ?$expand= not working in API using GET statement in postman
    Thanks YunZHu, for customer it worked.I tried with another URL for Salesinvoice as below,
     
     
    SalesInvoice for page 30012 is also created in webservices. but it throwed error as below
     
    "message": "No HTTP resource was found that matches the request URI 'https://api.businesscentral.dynamics.com/v2.0/6f12f387-6e87-41ea-a072-9d8cae6a48e8/sandbox/api/v2.0/companies(companyid)/salesInvoice?tenant=msweua9310t86169638&aid=FIN'."
     
    Can i know what the issue with URL is. 
     
    Is the process for customized page URL also different.
  • Verified answer
    YUN ZHU Profile Picture
    YUN ZHU 63,922 Super User on at
    ?$expand= not working in API using GET statement in postman
    Hi, your endpoint is incorrect, please try the following.
    https://api.businesscentral.dynamics.com/v2.0/c8558e71-6ad8-4fcd-9f29-3ca165b41bbe/Sandbox242/api/v2.0/companies(2c6ea79a-9223-ef11-8414-6045bdc8cdaf)/customers?$expand=customerFinancialDetail
     
    Thanks.
    ZHU
  • Suggested answer
    Tech_BC_Gokul Profile Picture
    Tech_BC_Gokul 263 on at
    ?$expand= not working in API using GET statement in postman
    Hi, 

    We faces this issue before we just tried this way it worked 

    Part page must have entityname and entitysetname it must be same to be given in sub page property with same entityname and setname 
     
    Note: this field is a case sensitive 
     
    part(additional; "<><><><><><>")
                    {
                        Multiplicity = ZeroOrOne;
                        EntityName = 'additionalInfoEntry';
                        EntitySetName = 'additionalsInfoEntries';
                        SubPageLink = "Registration ID" = field("Registration ID");
                    }
  • Verified answer
    Mohana Yadav Profile Picture
    Mohana Yadav 50,341 Super User on at
    ?$expand= not working in API using GET statement in postman
    AFAIK, it is not possible to use ?$expand with ODATA web services.
    Please try with APIs

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,773 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,513 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans