You need to sign in to do that
Don't have an account?
Dimitar Dimitrov 34
Return to previous page from "Create new sObject" page.
Hi all and Happy new year.
I had this task to create a custom Related list on the Account Page Layout with Visualforce and it all works fine. I've got all the records that i need and all the required fields and of course "New Project" button.
However the only issue is that when i added the "New BD Project" button, when the new page is opened and the user change his mind and press "Cancel" it returns to the Visualforce page only, not to the Account Page Layout.
I tried different solution, but i could not make it work.
Here is the commandlink button
I found the whole Visualforce page and Controller in another solution which was for Contact Related list and i modified it to fit my requirements. The only change is that in the working Contact solution(where when you press cancel it returns you to the previous page) is that the code for the New Object is in the Controler:
Did any of you guys had a similar issue and found a solution.
Kind regards,
Dimitar
Here is the controller and the Visualforce that i'm using.:
I had this task to create a custom Related list on the Account Page Layout with Visualforce and it all works fine. I've got all the records that i need and all the required fields and of course "New Project" button.
However the only issue is that when i added the "New BD Project" button, when the new page is opened and the user change his mind and press "Cancel" it returns to the Visualforce page only, not to the Account Page Layout.
I tried different solution, but i could not make it work.
Here is the commandlink button
<div style="margin-left: 30%;"> <apex:commandLink value="New BD Project" action=" {!URLFOR($Action.BD_Project__c.New)}" target="_parent" styleClass="btn" style="text- decoration:none;padding:4px;"/> </div>
I found the whole Visualforce page and Controller in another solution which was for Contact Related list and i modified it to fit my requirements. The only change is that in the working Contact solution(where when you press cancel it returns you to the previous page) is that the code for the New Object is in the Controler:
public pageReference newContact() { pageReference pageRef = new pageReference(URL.getSalesforceBaseUrl().toExternalForm() + '/003/e?&retURL=' + accounts.id); return pageRef; }
Did any of you guys had a similar issue and found a solution.
Kind regards,
Dimitar
Here is the controller and the Visualforce that i'm using.:
You need to set parameter in your URLFOR method.
https://help.salesforce.com/articleView?id=custom_links_constructing.htm&type=5 (https://help.salesforce.com/articleView?id=custom_links_constructing.htm&type=5)
All Answers
You need to set parameter in your URLFOR method.
https://help.salesforce.com/articleView?id=custom_links_constructing.htm&type=5 (https://help.salesforce.com/articleView?id=custom_links_constructing.htm&type=5)
Dushyant,
thank you for your reply,
I managed to make it work, here is the code:
Kind regards,
Dimitar