How to set reference in Journal entry programmatically

SOLVED

Hi all,

I tried setting the reference like this, but I guess the Journal Entry reference field is not BatchReference. Anyone know how and which field is use to set the Journal Entry reference?

Sage.Accounting.NominalLedger.NominalNextJournalReferenceNumber nextJournalReferenceNumber = Sage.Accounting.NominalLedger.NominalNextJournalReferenceNumberFactory.Factory.Fetch();
string nextjrn = nextJournalReferenceNumber.GetNextJournalReferenceNo();
instrument.BatchReference = nextjrn;