You need to sign in to do that
Don't have an account?
Tolga Sunar
Page redirect problem in SF1 custom quick action button for Approving a record
Hello,
I am developing a custom object-specific quick action for letting users approve or reject a record which has a pending approval request, on SF1. I've set up a VF and controller, and they work as intended; upon clicking on quick action, record becomes approved.
However, I am trying to make the quick action button to redirect back to record detail page. Instead, it simply brings the comment insertion page with "Save" button greyed out and no comment textbox. I have to click "cancel" to navigate back to record detail page that is not refreshed (fields come out as not updated by approval actions etc...)
Here is my Visualforce code:
On desktop interface, redirection is successful, however on SF1 I have this problem.
Screenshots (record detail page and the page upon clicking (the popup saying "Record is Approved" appears shortly after this page shows up).
Any help or idea is greatly appreciated. I think this is unfixable because of SF1 design, but I hope that someone already encountered this problem and found a solution...
Thanks in advance.
I am developing a custom object-specific quick action for letting users approve or reject a record which has a pending approval request, on SF1. I've set up a VF and controller, and they work as intended; upon clicking on quick action, record becomes approved.
However, I am trying to make the quick action button to redirect back to record detail page. Instead, it simply brings the comment insertion page with "Save" button greyed out and no comment textbox. I have to click "cancel" to navigate back to record detail page that is not refreshed (fields come out as not updated by approval actions etc...)
Here is my Visualforce code:
<apex:page standardController="PR_PO__c" extensions="ApproveActionVfc" action="{!redirect}"> <script> try { sforce.one.navigateToURL('/{!PR_PO_ID}'); } catch(e) { window.location.href = '/{!PR_PO_ID}'; } </script> </apex:page>PR_PO_ID here is the record ID that is fetched inside and transferred from the extension.
On desktop interface, redirection is successful, however on SF1 I have this problem.
Screenshots (record detail page and the page upon clicking (the popup saying "Record is Approved" appears shortly after this page shows up).
Any help or idea is greatly appreciated. I think this is unfixable because of SF1 design, but I hope that someone already encountered this problem and found a solution...
Thanks in advance.
You can try out with "navigateToSObject" method If that didn't work out then you can also give this a shot
Hope this will help you.
Thanks
All Answers
- In the apex:page tag, the defined action has nothing to do with redirection as opposed to its name. I copied that from another code and did not rename. This action simply approves the current approval request in the extension.
- sforce.one.navigateToSObject does not work as well.
Thanks.Hi Tolga,
Did you included following script in your page?
I did not include that script. I have just added that to my code and did a test, unfortunately it didn't fix the problem.
Thank you anyway for your interest on this topic
You can try out with "navigateToSObject" method If that didn't work out then you can also give this a shot
Hope this will help you.
Thanks
My apologies for such a late answer. I've set this issue as idle, since this is an optional development in my schedule. If I ever have to revise this development in the future, I will certainly take your latest suggestions in consideration! Thanks a lot for your interest again.