Sage CRM Screens can exist in different ‘Modes’. The basic two modes that we have to worry about in Client Side code are View and Edit.
We can use the fact that in Sage CRM <INPUT> HTML tags are named and have an ID with same name as the physical field in the database. e.g. <input name=comp_name id=comp_name>. And these are only written into the page when the screen is in Edit Mode. If the <input> tag for a field exists then the page is in Edit mode and if it doesn't then it is in View mode.
In Sage CRM Client Side API has a method of checking mode.
//Detect Mode in Company Screen
var strMode = crm.fields("comp_name").getMode();