Thursday, February 8, 2018

How to fix Suspended Values in Financial Dimensions lookup in Customer ,vendor....etc.


Forms >DimensionDefaultingLookup >Methods>init

  //Add below code++
        qbds =  queryBuildDataSource.addDataSource(tableNum(DimensionAttributeValue));
        qbds.relations(true);
        qbds.joinMode(JoinMode::InnerJoin);
        qbds.fetchMode(QueryFetchMode::One2One);
        qbds.addLink(dimAttrViewContract.parmKeyFieldId(),fieldNum(DimensionAttributeValue,EntityInstance));
        qbds.addRange(fieldNum(DimensionAttributeValue,DimensionAttribute)).value(strFmt("%1",dimAttr.RecId));
        qbds.addRange(fieldNum(DimensionAttributeValue,IsSuspended)).value(SysQuery::value(NoYes::No));

        ledger = Ledger::findByLegalEntity(CompanyInfo::find().RecId).RecId;

        qbdsLedger = qbds.addDataSource(tableNum(DimensionAttrValueLedgerOverride));
        qbdsLedger.joinMode(JoinMode::NoExistsJoin);
        qbdsLedger.fetchMode(QueryFetchMode::One2One);
        qbdsLedger.addLink(fieldNum(DimensionAttributeValue,RecId),fieldNum(DimensionAttrValueLedgerOverride,DimensionAttributeValue));
        qbdsLedger.addRange(fieldNum(DimensionAttrValueLedgerOverride,Ledger)).value(strFmt("%1",ledger));
        qbdsLedger.addRange(fieldNum(DimensionAttrValueLedgerOverride,IsSuspended)).value(SysQuery::value(NoYes::Yes));
        //Add below code--

Reference:

https://community.dynamics.com/ax/b/meritmatters/archive/2016/01/28/financial-dimensions-lookup

update_recordset with joins

 update_recordset with joins update_recordSet storeTransfer         setting      TransactionId = transfertable.TransferId     join transfert...