microsoft / AL

Home of the Dynamics 365 Business Central AL Language extension for Visual Studio Code. Used to track issues regarding the latest version of the AL compiler and developer tools available in the Visual Studio Code Marketplace or as part of the AL Developer Preview builds for Dynamics 365 Business Central.
MIT License
718 stars 242 forks source link

New Invisible Error in Querie after migratating in V24 (Saas) #7743

Closed kbridonneau closed 1 month ago

kbridonneau commented 1 month ago

Hello, since the update to v24, we have encountered an error (which does not trigger any Business Central error) on one of our queries. After several tests, it seems that this may be related to some of our fields that are in the filter format. For example this querrie:

`///

/// Query API-Today Total Order CP0 (ID 50001). /// query 50001 "API-Today Total Order CP0" { APIGroup = 'cap'; APIPublisher = 'cap'; APIVersion = 'v1.0'; EntityName = 'todayTotalOrder'; EntitySetName = 'todayTotalOrders'; QueryType = API;

elements
{
    dataitem(salesHeader; "Sales Header")
    {

        filter(documentType; "Document Type")
        {

        }

        column(sellToCustomerNo; "Sell-to Customer No.")
        {
        }

        filter(creationDate; "Creation Date CP0")
        {

        }

        dataitem(salesLine; "Sales Line")
        {
            DataItemLink = "Document No." = salesHeader."No.";

            filter(type; Type)
            {
            }

            column(sumLineAmount; "Line Amount")
            {
                Method = Sum;
            }

        }

    }

}
var
    endDate: DateTime;
    startDate: DateTime;

trigger OnBeforeOpen()
begin

    //La startDate est à la date d'hier à 18h01:00
    startDate := CreateDateTime(CalcDate('<-1D>', Today()), 180100T);

    //La endDate est à la date d'aujourd'hui à 18h00:59
    endDate := CreateDateTime(Today(), 180059T);

    SetRange(documentType, Enum::"Sales Document Type"::Order);
    SetRange(creationDate, startDate, endDate);
    SetRange(type, Enum::"Sales Line Type"::Item);
end;

} `

Return code 200 but the json is malformated by Business central : $homeUrl//todayTotalOrders?%24filter=sellToCustomerNo eq %273030%27 (worked fine in v23)

badOk

but if i change two filter in column (Document Type and Type) : ` query 50001 "API-Today Total Order CP0" { APIGroup = 'cap'; APIPublisher = 'cap'; APIVersion = 'v1.0'; EntityName = 'todayTotalOrder'; EntitySetName = 'todayTotalOrders'; QueryType = API;

elements
{
    dataitem(salesHeader; "Sales Header")
    {

        column(documentType; "Document Type")
        {

        }

        column(sellToCustomerNo; "Sell-to Customer No.")
        {
        }

        filter(creationDate; "Creation Date CP0")
        {

        }

        dataitem(salesLine; "Sales Line")
        {
            DataItemLink = "Document No." = salesHeader."No.";

            column(type; Type)
            {
            }

            column(sumLineAmount; "Line Amount")
            {
                Method = Sum;
            }

        }

    }

}
var
    endDate: DateTime;
    startDate: DateTime;

trigger OnBeforeOpen()
begin

    //La startDate est à la date d'hier à 18h01:00
    startDate := CreateDateTime(CalcDate('<-1D>', Today()), 180100T);

    //La endDate est à la date d'aujourd'hui à 18h00:59
    endDate := CreateDateTime(Today(), 180059T);

    SetRange(documentType, Enum::"Sales Document Type"::Order);
    SetRange(creationDate, startDate, endDate);
    SetRange(type, Enum::"Sales Line Type"::Item);
end;

} `

The result was ok : Ok

I think a new system bug has appeared with v24. If anyone has an idea or can tell me how to report the information directly to Microsoft?

Thank you.

Kevin

### Tasks
BazookaMusic commented 1 month ago

Hello, please report this as a support request as it looks like runtime issue affecting live customers.

You can do the following: Open a support request to CSS through the PartnerSource portal Open a bug in Collaborate Contact your Service Account Manager (SAM) in your local subsidiary to understand what is included in your contract as of support incident and PAH (Partner Advisory Hours). Your SAM might also direct you "step by step" how to open a support request or how to get credentials, if this is the first time for you or your company.