I've got a VisualForce page that is enabled for Mobile; it uses Opportunity as its StandardController, and I've created a custom action on the Opportunity object that uses this action. I then enabled the Chatter feed and dropped this action into the publisher. Now, in SF1, when I go to an opportunity, I can see my custom action, but when I click on it, there are issues. The page has the following Javascript in it:
<apex:page standardController="Opportunity"> <script type="text/javascript"> setTimeout(function() { var myURL = '/apex/MyPage?oid={!Opportunity.Id}'; if(typeof sforce != 'undefined' && sforce != null) { sforce.one.navigateToURL(myURL + '&isdtp=p1'); } else { document.write("Not enabled except for mobile."); } }, 1); </script> Redirecting... </apex:page>
I found a reference to the isdtp querystring variable in another post, and when I use it, SF1 redirects me to my webtab. If I remove that querystring variable, I am not redirected at all, there is no error, and there's nothing in the console. The issue is that I want to pass the opportunityID that I'm currently on to MyPage, and when I have the isdtp variable in the querystring, it strips off the oid querystring variable before it gets to MyPage. My preference would be to not use the isdtp querystring variable, because I think it's a hack.
Does anybody have any suggestions?