2

Suggested by Jan Šmejda New 

When the Project ID field on the Expense report header is updated, there is wrong Travel requisition found and financial dimensions are taken over from the first (ever) mapped Travel requisition and not the Travel requisition mapped to current Expense report.

Current code from method setDefaultDimension() on TrvExpTable table:


select firstonly DefaultDimension, ReferenceDataAreaId, RecId from reqTable

  exists join trvExpTableTrvRequisitionTable

    where trvExpTableTrvRequisitionTable.TrvExpTable == this.RecId;


Requested code including the correct condition in the Exists join:


        select firstonly DefaultDimension, ReferenceDataAreaId, RecId from reqTable

          exists join trvExpTableTrvRequisitionTable

            where trvExpTableTrvRequisitionTable.TrvExpTable == this.RecId

              && trvExpTableTrvRequisitionTable.TrvRequisitionTable == reqTable.RecId;