Hi there,
Is it possible to create a new AL API Query that links 3 or more DataItems?
For example, say I want to link the tables 81 (Gen. Journal Line), 288 (Vendor Bank Account) and 23 (Vendor).
I can link two of them no problem.
query 53000 TestQuery
{
QueryType = API;
APIPublisher = 'Test';
APIGroup = 'GroupName';
APIVersion = 'v2.0';
EntityName = 'TestQuery';
EntitySetName = 'TestQuerys';
elements
{
dataitem(DataItemName1; "Gen. Journal Line")
{
column(Recipient_Bank_Account; "Recipient Bank Account")
{
}
column(Amount; Amount)
{
}
column(Account_No_; "Account No.")
{
}
column(Document_No_; "Document No.")
{
}
dataitem(DataItemName2; Vendor)
{
DataItemLink = "No." = DataItemName1."Account No.";
SqlJoinType = InnerJoin;
column(Our_Account_No_; "Our Account No.")
{
}
column(Vendor_Name; Name)
{ }
column(Creditor_No_; "Creditor No.")
{ }
}
}
}
}
But as soon as I add a third DataItem it does not compile anymore.

Any help would be greatly appreciated.
Thanks