Fortunately there is a supported way in the latest version of Dynamics 365. Here is the short tip:
Create a js webresource:
var formContext = executionContext.getFormContext();
Then you need to call this function, so in the form, add the library to the form and create an Onload eventInsert the function setregardingcontext and do not forget to tick the checkbox which enables context sending.
I tested it and it work is the classic UI and in the Unified interface as well. It is also supported in the interactive forms, but it does not work in the Dynamics 365 App for Outlook. I will be contacting Microsoft Support regarding this. Keep watching for the update.