Fork me on GitHub

Other articles


  1. Using While Select and Ranges in X++ [AX2012]

    Solution

    An example of While/Select statements to find InventSerials, when Works Order is known. Here I also will use a chance to note the ListEnumerator. No Joins are used in this example.

    An example of achieving same result using Queries.

    Class declaration

    public class YourClass
    {
        InventTransOrigin               inventTransOrigin;
        InventTrans                     inventTrans ...
    read more

    There are comments. Feel free to leave your comment.

  2. AX/SQL Best Practices

    Check current SQL Server values:

    EXEC sp_configure;
    

    1) Trace flags 4136 ,1117 and 4199 enabled on SQL server.

    DBCC TRACEON(4136,-1) 
    DBCC TRACEON(1117,-1) /* If you've configured multiple data files and you want to allow auto grow, consider enabling trace flag 1117, which will force all data ...
    read more

    There are comments. Feel free to leave your comment.

  3. Checking if a Specific Record Exists in a Table [AX2012]

    As a Method

    Class declaration

    class YourClass
    {
        InventSerial inventSerial;
    }
    

    Method

    public static boolean existsSerial(str 20 _serial)
    {
        return _serial
            && (select firstOnly RecId from inventSerial
                /* index hint GroupIdx //index hint is IGNORED in AX 2012. */
                where inventSerial.InventSerialId == _serial).RecId != 0;
    }
    

    As a Service

    Service data contract attribute

    [DataContractAttribute]
    class YourServiceDataContract ...
    read more

    There are comments. Feel free to leave your comment.

Page 1 / 1

links

social