7

I have a visualforce page that is overridding the Account New button. To make the New button show up in the Salesforce1 app, the page needs to be enabled for movile devices. This page is very complex and we don't want to use it in the Salesforce1 app.

So to try some things out, I created a new vf page to use for redirection. All it basically has in it is javascript to identify if it's in the salesforce1 app or not, then redirect appropriately.

<script>

$(document).ready(function(){
     isMobile();
});


function isMobile(){

    if( (typeof sforce.one != 'undefined') && (sforce.one != null) ) {

        // In Salesforce1, navigate to create account record standard page
        sforce.one.createRecord("Account");    

    }else{
        //navigate to vf page
        window.location.assign("/apex/VFPage");
    }

}
</script>

Within a browser on a non mobile device, it is redirecting to the VFpage as expected. But when in the Salesforce1 app, after clicking New, it shows a blank page (assuming is my vf page for redirection), but after about 20 seconds, it shows a blank white page, then after about 10 more seconds, finally opens the standard create record page.

Has anyone used the navigation sforce.one javascript object like this yet? Is anyone experiencing lagging performance with salesforce1 app? Is there a better way to do this type of redirection?

Thanks!

  • Do you still have this issue? I'm wondering, if you do a "New account" via the regular way, does it also take so long to open the edit page? Then, it might be an issue with something on your account edit page like having too much fields or other things slowing the page down. – KoenVM Jan 2 '14 at 15:55
  • I did remove the override and it there still is a lag with the standard "New" functionality. We do have many fields on the page layout so most likely that is the cause. Thanks for your help. – user4945 Jan 2 '14 at 17:28
3

I have used the sforce object to navigate directly to an account list view using the sforce.navigateToListView method. See my question How to use the sforce.one.navigateToList method?. I did not experience any lag time. I haven't implemented the createRecord, though.

3

I have used navigation : sforce.one.navigateToSObject(recordId,view) where you can navigate to an specific record , and it is working. Then if you VF is linked to an object might be you would like to use it. Also I would like to add that this navigation is working at this moment only with the first parameter :sforce.one.navigateToSObject(recordId) you can use the second one : view , but it won't send you to the selected view ( "chatter" or "detail" or "related" list views). As I commented I've been using this navigation and is working but no with the second parameter and I've been in contact with SF support and they confirmed to me that this call-navigation will be fully implemented for Summer '14 (safe harbor), meanwhile we can use it knowing that it will always redirect you to the "detail" view.

Then might be we need to wait a little bit for them.

About salesforce.one.createRecord please have a look to this link :) How to use sforce.one.CreateRecord method?

Hope it helps.

0

like stated in the last comment, the standard "new" button also has the same lag so the issue is not related to the "sforce.one.createRecord" method but to something on the object's edit page. (too many fields or some other heavy components)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.