Get Client URL in JavaScript for Dynamics 365 CE scripts

To get client URL use below script. It will return the URL like this https://[org].crm.dynamics.com. hope this helps.