Sometimes you need to get Object Type Code of current opened record. Yes, it’s safer to use supported ways like call to metadata through endpoints but sometimes you can ignore that recommendation. So the trick is:

var context = Xrm.Page.context;
var params = context.getQueryStringParameters();
var objectTypeCode = params.etc;


Запись Quick and dirty way to get current record Object Type Code впервые появилась CRM Mentor.