How to set the docstatus of Custom created doctype?

Hai

Is docstatus of the custom doctype set by default?
ie, Draft =0, Submitted =1, Cancelled =2

When I checked using
alert(doc.docstatus)
I saw it as “Undefined”!!!

How to set status of the custom created doctype?

write alert(cur_frm.doc.docstatus)

THANK YOU…
It shows the correct status!
But I would like to know the reason, could you please?

@Amalendu to get value of fields in javascript(frappe) you need to write cur_frm.doc.FIELDNAME

@kolate_sambhaji ok. Thanks…