ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

Question: In the sales order API order date is actually the document date

Open CarlOhlsson opened this issue 4 years ago • 2 comments

I just got question from a customer that something was strange with the order dates they were reading into power bi from business central. They claim the order date sent back from the API was not at all the order date when they looked on the sales order inside of BC. I look a look at your API here on github and found the following, you are using document date and call it order date. Both me and the customer find this really strange and confusing.

Is this a mistake or as designed?

Link to the API page itself: https://github.com/microsoft/ALAppExtensions/blob/main/Apps/W1/APIV2/app/src/pages/APIV2SalesOrders.Page.al

field(orderDate; "Document Date")
{
    Caption = 'Order Date';

    trigger OnValidate()
    begin
        DocumentDateVar := "Document Date";
        DocumentDateSet := true;

        RegisterFieldSet(FieldNo("Document Date"));
    end;
}

Internal work item: AB#524051

CarlOhlsson avatar Jul 07 '22 20:07 CarlOhlsson

I agree! To me this is a bug as there is no way to get the real "Order Date" from the API apparently

joakimbeng avatar Jan 20 '23 07:01 joakimbeng

This is by design. When APIs first created, in order to keep the interface consistent for the Graph services, Document Date caption was named Order Date. Changing this would unfortunately be a breaking change. If you need this field to be named Document Date, I suggest copy pasting the standard API page into a custom one.

onbuyuka avatar Apr 06 '24 17:04 onbuyuka