Here is a quick tip to tell if a form is being created or updated in Javascript, this can be very useful for form load events and creating code which needs to be run when a form is being created, like setting the values of variables when a form is created.
var formType= Xrm.Page.ui.getFormType();
getFormType() function returns a number
If the return value is 1 – Form context is Create
If the return value is 2 – Form context is Update



Goodfella
February 23, 2012
Hi,
and what about delete state ? How can I start jscript if record is being deleted ?