The X++ SQL statement update_recordset enables you to update multiple rows in a single trip to the server
update_recordset generalJournalAccountEntryUpdateRecSet
setting
TTC_EOMCheckField=NoYes::Yes
join generalJournalEntryUpdateRecSet
where generalJournalAccountEntryUpdateRecSet.GeneralJournalEntry == generalJournalEntryUpdateRecSet.RecId
&& generalJournalEntryUpdateRecSet.AccountingDate >= fromDate
&& generalJournalEntryUpdateRecSet.AccountingDate <= toDate
&& generalJournalEntryUpdateRecSet.Ledger == fromLedger.RecId
&& generalJournalEntryUpdateRecSet.PostingLayer == CurrentOperationsTax::Current
join DimensionAttributeLevelValueAllViewUpdateRecSet
where generalJournalAccountEntryUpdateRecSet.LedgerDimension == DimensionAttributeLevelValueAllViewUpdateRecSet.ValueCombinationRecId
&& DimensionAttributeLevelValueAllViewUpdateRecSet.DisplayValue == division
&& DimensionAttributeLevelValueAllViewUpdateRecSet.DimensionAttribute == DimensionAttribute::findByName("Division").RecId
join DimensionAttributeLevelValueAllViewUpdateRecSet2
where DimensionAttributeLevelValueAllViewUpdateRecSet2.ValueCombinationRecId == DimensionAttributeLevelValueAllViewUpdateRecSet.ValueCombinationRecId
&& DimensionAttributeLevelValueAllViewUpdateRecSet2.DisplayValue == selectedMainAccount
&& DimensionAttributeLevelValueAllViewUpdateRecSet2.DimensionAttribute == DimensionAttribute::findByName("MainAccount").RecId;
}
Picture of same code with indentation :-
update_recordset generalJournalAccountEntryUpdateRecSet
setting
TTC_EOMCheckField=NoYes::Yes
join generalJournalEntryUpdateRecSet
where generalJournalAccountEntryUpdateRecSet.GeneralJournalEntry == generalJournalEntryUpdateRecSet.RecId
&& generalJournalEntryUpdateRecSet.AccountingDate >= fromDate
&& generalJournalEntryUpdateRecSet.AccountingDate <= toDate
&& generalJournalEntryUpdateRecSet.Ledger == fromLedger.RecId
&& generalJournalEntryUpdateRecSet.PostingLayer == CurrentOperationsTax::Current
join DimensionAttributeLevelValueAllViewUpdateRecSet
where generalJournalAccountEntryUpdateRecSet.LedgerDimension == DimensionAttributeLevelValueAllViewUpdateRecSet.ValueCombinationRecId
&& DimensionAttributeLevelValueAllViewUpdateRecSet.DisplayValue == division
&& DimensionAttributeLevelValueAllViewUpdateRecSet.DimensionAttribute == DimensionAttribute::findByName("Division").RecId
join DimensionAttributeLevelValueAllViewUpdateRecSet2
where DimensionAttributeLevelValueAllViewUpdateRecSet2.ValueCombinationRecId == DimensionAttributeLevelValueAllViewUpdateRecSet.ValueCombinationRecId
&& DimensionAttributeLevelValueAllViewUpdateRecSet2.DisplayValue == selectedMainAccount
&& DimensionAttributeLevelValueAllViewUpdateRecSet2.DimensionAttribute == DimensionAttribute::findByName("MainAccount").RecId;
}
Picture of same code with indentation :-