{ "error": { "code": "BadRequest", "message": "Could not find a property named 'items' on type 'NAV.salesReturnOrder'. CorrelationId: d09b8fd3-1119-46fe-9c07-226d1bcdc726." } }
page 50003 "SalesReturnOrder_REAP" { PageType = API; Caption = 'modifySalesReturnOrder'; APIPublisher = '{{publisher}}'; APIGroup = '{{apiGroup}}'; APIVersion = 'v1.0'; EntityName = 'salesReturnOrder'; EntitySetName = 'salesReturnOrder'; SourceTable = "Sales Header"; DelayedInsert = true; ModifyAllowed = true; DeleteAllowed = false; layout { area(Content) { group(GroupName) { field(customerNo; "Sell-to Customer No.") { } field(documentNo; "No.") { } field(type; "Document Type") { } part(items; Items_REAP) { ApplicationArea = All; EntityName = 'item'; EntitySetName = 'items'; SubPageLink = "Document No." = field("No."), "Document Type" = Const("Return Order"); } } } } }
page 50004 "Items_REAP" { PageType = API; Caption = 'items'; APIPublisher = '{{publisher}}'; APIGroup = '{{apiGroup}}'; APIVersion = 'v1.0'; EntityName = 'item'; EntitySetName = 'items'; SourceTable = "Sales Line"; DelayedInsert = true; ModifyAllowed = false; DeleteAllowed = false; layout[s][/s] { area(Content) { repeater(GroupName) { field(itemNo; "No.") { } field(itemType; "Type") { } field(itemDescription; "Description") { } part(serialNo; serialNo_REAP) { EntityName = 'serialNo'; EntitySetName = 'serialNo'; SubPageLink = "Item No." = field("No."), "Source ID" = field("Document No."); } } } } trigger OnInsertRecord(BelowxRec: Boolean): Boolean begin Insert(true); // Call the Table trigger because the API does not call it. exit(false); // Must abort the Page trigger because the record has already been inserted. end;
Answers
If you run into problem with that then you can try complex types.
https://forum.mibuso.com/discussion/72539/nav-2018-api-complex-types#latest
Same answer as above It works in docker, but not here.
Thank you for your responses though!
in your docker url you are using the API endpoint, in your BC online url you are using the ODataV4 endpoint (this endpoint does not support deep inserts)
try changing
https://api.businesscentral.dynamics.com/v1.0/{{tenant}}/{{environment}}/ODataV4/Company('{{company2}}')/salesReturnOrder?$expand=items
to
https://api.businesscentral.dynamics.com/v1.0/{{tenant}}/{{environment}}/api/{{publisher}}/{{apiGroup}}/v1.0/companies({{company}})/salesReturnOrder?$expand=items
Cool, guess this has changed in BC, just out of curiosity, how is the syntax to expand the third level, in your case serialNo?
It is now possible to nest API pages, if you want to expand nested collections, you can use this format for this example
https://api.businesscentral.dynamics.com/v1.0/{{tenant}}/{{environment}}/api/{{publisher}}/{{apiGroup}}/v1.0/companies({{company}})/salesReturnOrder?$expand=items($expand=serialNos)
@skollops , I just noticed a little error in your Items_REAP page should be
and then also be sure to check your settings (entityname, entitysetname) on your serialNo_REAP page