GL transactions (Ledger and Project type)

trying to create header and lines transactions and post those transactions. using X++ code.

i am creating header .

while creating lines

{ line for LedgerJournalTrans ie. type Ledger

  1. another LedgerJournalTrans ie. type Project.

  2. another for LedgerJournalTrans_Project ledgerProjects


using checkpost posting the transactions.

i would like know that this logic is correct.

thanks for your help