Posting_date returning as undefined

For some reason posting_date is returning undefined. I have tried console.log(cur_frm.posting_date) in Journal Entry scripts and is coming back undefined.

Returning transaction_date in a Purchase Order script acts as expected, returning whatever the date is set as.

Is there some special behaviour for posting_date?

So it looks like in Journal Entry the posting_date is nested in frm.selected_doc. In Sales Invoice and Purchase Invoice (the other doctypes I have checked) it is an element of frm. Anyone have any idea why this is and if it affects any other doctypes?

Try with frm.doc.posting_date. Share your script

This works, thanks. Why is this (seemingly) only an issue for Journal Entry docs though?