Wednesday, 15 March 2017

Get Current Record for different data source x++

By this we can use same MenuItem at different place and for different data source.

---------------------------------------------------------------------------
Public static void main(Args _args)
{
    RetailStatementTable    retailStatementTable;
    RetailStatementLine     retailStatementLine;
    RetailStatementId         StatementID;
    RetailCountedAmountUpdate  RetailCountedAmountUpdate = new RetailCountedAmountUpdate();
    ;

     switch (_args.dataset())
    {
            case tablenum(RetailStatementTable) :
            retailStatementTable =  _args.record();
            StatementID = retailStatementTable.statementId;
            break;
           
            case tablenum(RetailStatementLine) :
            retailStatementLine =  _args.record();
            StatementID = retailStatementLine.statementId;
            break;
    }
 

    RetailCountedAmountUpdate.run(StatementID);

}

No comments:

Post a Comment