For example this querrie:
/// <summary>/// Query API-Today Total Order CP0 (ID 50001)./// </summary>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;}
/// <summary>/// Query API-Today Total Order CP0 (ID 50001)./// </summary>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;}