Skip to main content The Trailblazer Community will be unavailable from 2/1/2025 to 2/2/2025. Please plan your activities accordingly.
Indhu R asked in #Mobile
Hi All,

I am new in Salesforce1 App development. I have created a VisualForce page which contains map, date picker, custom visualforce components and visuaforce remoting methods. I have created a functionality which redirects to another page url using window.location.href. Then i noticed from documentations that window.location will not work in mobile devices. Then on further analysis found that we need to use sforce.one.naviagteToURL and my code is

Redirect : function ()

{

    var url = '/apex/MyCustomPage';

    if( (typeof sforce != 'undefined') && (sforce != null) ) 

    {

          // Salesforce1 navigation

          sforce.one.navigateToURL(url);

    }

    else

    {

          // Set the windows URL

          window.location.href = url;

    }

}

This above code works fine in my desktop version but when i use the same in mobile device, the components like DatePicker, Custom Compoents, map inside MyCustomPage are not loaded in the page when this redirect method is called. Am breaking my heads with this. Anyone please help me out.

Thanks in Advance,

Indhu
2 answers
  1. Jun 22, 2015, 1:56 PM
    Hi Sandeep,

    I have done the same logic in redirecting to page but you have redirected to different versions of the page. And in my scenario, the redirection works fine with the page url but if i include parameters in my url the components in the page are not loading.

    Thanks, 

    Indhu
Loading
0/9000