You need to sign in to do that
Don't have an account?

Salesforce Button Redirect
My redirect button is not working. Not sure why or where I'm missing the code. Can anyone help? The goal is when it updates I want it to go to a webpage.
This is my button
<apex:commandButton value="Update" action="{!save}" styleClass="btn pull-right" onclick="$j('#pleaseWaitDialog').modal('show')" oncomplete="$j('#pleaseWaitDialog').modal('hide')"/>
<div class="modal fade" id="pleaseWaitDialog" data-backdrop="static" data-keyboard="false"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-body"> <h3>Processing...</h3><br/> <div class="progress"> <div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width:100%"> </div> </div> </div> </div> </div> </div>
This is my APEX
public void save() { try { if(accountUpdate.Account__c == null) { accountUpdate.Account__c = accountId; } upsert accountUpdate; PageReference reRend = new PageReference('GOOGLE.COM'); reRend.setRedirect(true); } catch(Exception e) { System.debug('------------- ERROR: ' + e.getStackTraceString()); System.debug('------------- ERROR: ' + e.getMessage()); ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'There was a problem while saving the account information.')); return; } }
Thanks
All Answers
Can you try to update your Save() method to return reRend? Let me know if you still have problem
I did a code where it will say recoed updated but would like to be able to send to a web page.
Do you mind to share the complete code? Cause the error message you mention is pointed to line 28, I cannot see what is in that line.
The line 28 is - return reRend; line.