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
This blog aims to provide some technical tips about Microsoft Azure & Dynamics 365 CRM - D. MANJALY