Search code examples
axaptadynamics-ax-2009ax

Pass a table method to addLink method of a QueryBuildDataSorce object


Is there any way to pass a table method instead of fieldid to addLink method of a QueryBuildDataSource object? I have this code:

qbdsLedgerTrans.addLink(
        FieldNum(LedgerTable, AccountNum), // Here i need to pass a conditional value of a LedgerTable method instead of a field
        FieldNum(LedgerTrans, AccountNum)
    );

Solution

  • I think no because the query API is tightly bound to tables in SQLServer and tables does not contain any method in SQLServer.

    The #addLink will be used to generate query join statement so there must use data present inside the database and method are not in the database but in the aod files.

    Depending on what you want to do you can have a method to encapsulate your logic and return the corrected fieldId.