web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

Notexists Join in AX2012/ D365 F&O X++

Rahul Kiran Profile Picture Rahul Kiran 481
Below is the example for how to use notexists join in x++.

In this scenario I'm deleting unused delivery modes from DLVMODE table in Dynamics 365 F&O.


/// <summary>
/// </summary>
class DeleteUnusedModeOfDeliveries
{       
    /// <summary>
    /// Runs the class with the specified arguments.
    /// </summary>
    /// <param name = "_args">The specified arguments.</param>
    public static void main(Args _args)
    {
        DlvMode    dlvMode;
        SalesTable  SalesTable;
        int i;
        ;

        ttsbegin;
        while select forupdate dlvMode notexists join SalesTable where dlvMode.Code ==   SalesTable.DlvMode
        {
            dlvMode.delete();
            i++;
        }
        Info(strFmt("Total deleted records - %1", i));

        ttscommit;
    }

}


@Rahul

This was originally posted here.

Comments

*This post is locked for comments