0

I have a custom button that will update a field in the account detail page which will input the long and lat but when I tried it in Salesforce1 mobile,it goes to a blank page. How can I set the page to redirect to view the account in mobile. It seems to work in a desktop.

public with sharing class GetGeolocationController {

    ApexPages.StandardController sc;

    Public decimal longT{get;set;}
    Public decimal latT{get;set;}


    public GetGeolocationController(ApexPages.StandardController sc){
        this.sc = sc;
    }

    public PageReference savePositionMethod(){
        Account acc = (Account)sc.getRecord();
        acc.Longitude__c = longT;
        acc.Latitude__c = latT;
        update acc;

        return null;
    }

}

1 Answer 1

0

Your page is not redirecting, so it's probably best if you changed:

update acc;
return null;

To:

return sc.save();

This will allow you to redirect to the account page after a successful save.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .