You need to sign in to do that
Don't have an account?
Jennifer.Schnell
Custom JavaScript Link Not Working after My Domain and Instance Refresh
We recently switched over to My Domain and also had an instance refresh over the weekend. I have one link on our home page that is not working, below is the code. I see it is referring to "ServerInstance", where do I go to update this? Thanks
window.open(getServerInstance() + "/apex/EditExpenseReportForward?retURL=%2Fa24%2Fo&save_new=1&sfdc.override=1");
function getServerInstance()
{
var url = window.location + "";
var urlParseArray = url.split(".");
var i;
var sInstance;
for(i=0; i< urlParseArray.length; i++) {
if (urlParseArray[i].indexOf("salesforce") != -1) {
sInstance = urlParseArray[i-1];
}
else if (urlParseArray[i].indexOf("force") != -1) {
sInstance = urlParseArray[i-2];
}
}
urlParseArray = sInstance.split("//");
sInstance = urlParseArray[0] + "//pse." + urlParseArray[1] + ".visual.force.com";
return sInstance;
}
window.open(getServerInstance() + "/apex/EditExpenseReportForward?retURL=%2Fa24%2Fo&save_new=1&sfdc.override=1");
function getServerInstance()
{
var url = window.location + "";
var urlParseArray = url.split(".");
var i;
var sInstance;
for(i=0; i< urlParseArray.length; i++) {
if (urlParseArray[i].indexOf("salesforce") != -1) {
sInstance = urlParseArray[i-1];
}
else if (urlParseArray[i].indexOf("force") != -1) {
sInstance = urlParseArray[i-2];
}
}
urlParseArray = sInstance.split("//");
sInstance = urlParseArray[0] + "//pse." + urlParseArray[1] + ".visual.force.com";
return sInstance;
}
Try it withoud getServerInstance() method. it will automatically populate with current salesforce instance.
use following:
Let me know if issue is persisting after that.
Thanks
Banwari
Visualforce Error
Page EditExpenseReportForward does not exist
Create Page EditExpenseReportForward
This error occurs when page is not availble in org. Now check the spelling of page name or page exists in org.
Thanks
Banwari