How to assing legal number to Journal Entry

Hi,

I have of one question, in the moment to create on Journal Entry, i need to assing the legal number by code, i try this way

/// CODE
Erp.Adapters.GLJournalEntryAdapter boGLJrn = new Erp.Adapters.GLJournalEntryAdapter(ARBOEStatusChgForm); boGLJrn.BOConnect();
Erp.Proxy.BO.GLJournalEntryImpl boGLJ = boGLJrn.BusinessObject as Erp.Proxy.BO.GLJournalEntryImpl;
Erp.BO.GLJournalEntryDataSet dsGLJ = new Erp.BO.GLJournalEntryDataSet();
dsGLJ = boGLJ.GetByGroupID(enT.Grupo);

bool RequiresUserInput;
boGLJ.PreGenLegalNum(dsGLJ,out RequiresUserInput);
boGLJ.GenLegalNum(dsGLJ);
boGLJ.Update(dsGLJ);