Dynamics AX 2012 x++ Enhancement, Now variables can be used in Selects

I have found the interesting enhancement in X++ Language. Now you can use the variables in the selects. scenario is that suppose you trying to copying bulk records in a table and one of the column you wanted is constant. like below i am trying to insert Fiscal periods records for a Ledger where record id of the ledger is Constant, so i took that in a variable and i am using it in the select.

RecId _ledgerRecId = Ledger::Current();

insert_recordset ledgerFiscalCalendarPeriod






select _ledgerRecId, RecId, status

from fiscalCalendarPeriod;

%d bloggers like this: