How to Create General journal header with multiple lines through the X++ code and post the journal entry AX 2009

How to Create General journal header with multiple lines through the X++ code and post the journal entry AX 2009