AX – D365FO – Select Statement with an Outer Join

static void OuterJoinSelectJob3(Args _args)
 {
     SalesOrder recSalesOrder;
     SalesOrderLine recSalesOrderLine;
     struct struct4;
     ;
     struct4 = new struct
         ("int SalesOrderID;"
         + "date DateAdded;"
         + "str SalesOrderLineID;"
         + "int Quantity"
         );
 
     while
     SELECT
         from
             recSalesOrder
             OUTER JOIN recSalesOrderLine
         WHERE
             recSalesOrder.SalesOrderID == recSalesOrderLine.SalesOrderID
             && recSalesOrderLine.Quantity == 66
     {
         struct4.value("SalesOrderID", recSalesOrder.SalesOrderID);
         struct4.value("DateAdded", recSalesOrder.DateAdded);
         struct4.value("SalesOrderLineID", recSalesOrderLine.SalesOrderLineID);
         struct4.value("Quantity", recSalesOrderLine.Quantity);
         info(struct4.toString());
     }
 }

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s