+ Start a Discussion
Jyoti Singh 9Jyoti Singh 9 

Create different pages for opportunity for desktop and mobile

Can anyone guide me on how can I create diff pages for creating new opportunity for web and mobile? May be show few fields on mobile abut full view on browser

How can I do that?
KaranrajKaranraj
No currently you can't create two different pagelayouts for Salesforce1 mobile and desktop. Vote for this Idea https://success.salesforce.com/ideaView?id=08730000000kxyTAAQ
 
Jyoti Singh 9Jyoti Singh 9
Is it possible to do it with Visualforce?
KaranrajKaranraj
Yes you can do it in java script for identifying the device and redirect to the correct VF page.
 
// Go back to the Account detail page
if( (typeof sforce != 'undefined') && (sforce != null) ) {
    // Salesforce1 VF page URL
   
}
else {
    // Set the Desktop VF page URL
    window.location.href = 
        '{!URLFOR($Action.Account.View, account.Id)}';
}

 
Jyoti Singh 9Jyoti Singh 9
This didn't work for me. It goes to same page irrespective of whether I'm in browser or on mobile
KaranrajKaranraj
Are you accessing page in Salesforce1 mobile app or in your mobile browser window? The above code will detect whether the visualforce page is running inside the Salesforce1 app or in deesktop window
Jyoti Singh 9Jyoti Singh 9
In browswer