How can I get the name of the current tenant my javascript is running in?
I'm generating emails with embedded url's pointing to items tabs etc. and I don't want to have to change the code for each tenant (Dev, QA, Prod, Demo etc)
It would be nice if I could get something like:
//This does not work
var modByUsr = userID;
var modByUserDetails = Security.loadUser(modByUsr);
var strTenant = modByUserDetails.customerToken;
Please help!
HI Anders,
Presently, this is not possible; you would need to hardcode the string. What are you trying to achieve with tenant names, if don't mind me asking? ))
We have several different tenants, (Dev, QA, Test, Proto, Prod environments). We send emails when we get an error from an interface thath have similar test and production environments, with a artificial url that will lead to workflow tab etc. The url contains dmsid and workareaid, and tenant. If I hardcode the url for the tenant, then it won't work in the testing and production environment without code changes. If my code could get the tenant name then problem would be fixed.
Thanks,
Anders
Thank you for the reply; the intent is clear. Getting tenant name via script isn't possible today as I had already mentioned. I don't have plans to add it, at least not near term. However, can offer a recommendation to create a picklist with all tenant options in all of your tenants such that you set a (default) value once, then referencing such from affected workspaces without changing their scripts. Surely possibly simpler approaches can be achieved depending on your setup. Let me know in private if wish to explore alternates.