I am facing an issue with a custom onclick-javascript button that is used in the Partner Portal, Console and in "regular" Salesforce. I have the following RequiredScripts in the button:
{!REQUIRESCRIPT("/soap/ajax/33.0/connection.js")}
{!REQUIRESCRIPT("/support/console/33.0/integration.js")}
This is working fine in the console and in regular console, but in the Partner Portal I get the following issue in my developer console (only when clicking the button the first time, clicking it again right after works fine):
I can see that if I manually try to access the url
"https://XXXXXXX.cs18.force.com/partners/support/console/33.0/integration.js"
I can see the script file, I have tried to in my Requirescript change the following: {!REQUIRESCRIPT("partners/support/console/33.0/integration.js")}
but that does not work neither, and I assume that would not work in the console anyway.
I could of course create two seperate buttons, one for the Partner Portal that does not have the {!REQUIRESCRIPT("/support/console/33.0/integration.js")}
at all. This is however my last resort, since it would mean that I would end up with two buttons on the Page Layout and this may confuse and irritate the users (even if they have different names).
This would be easy to fix if Salesforce would have a way of customizing the visibility and access of custom buttons based on permission sets, profiles, roles or whatever, but for now I am in the dark here.
Does anyone have any suggestions regarding this?
Ciao!
{!REQUIRESCRIPT(IF($User.UserType='PowerPartner',NULL,'/support/console/...')}
? or some variation of this? See doc on UserType in the SFDC Objects Guide