Detect which grid module the Grid application is currently in

What I want to do is format the fields differently if the “Details” are presented instead of the “Grid”.

Ideally I’d like to change the content / format of some fields in the onRecord event. I’m looking for something that could do something like this ,

if In_Details then
   ... format fields for details
else In_Grid then
   ... format fields for grid

Does anyone know if this is possible, I couldn’t instantly see any macro that could do this.

thanks.