If first question is answered please mark as verified for others.
Second question answer is very simple, once you get the Int64 value please pass by below method
\Classes\AxdDimensionUtil\getLedgerAccountValue which will return the container from where you can configure your ledger account string.
Exam:
container con;
con = AxdDimensionUtil::getLedgerAccountValue (recid);
Hope it is clear now.