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

How to display a newly created record from process builder?
A custom object, called "RFP", is created via process builder when the Opportunity is saved with a Stage = "Proposal". The RFP record is created but it is not displayed for editing. The user must go to the related list and click on the RFP name and then the Edit button to display the RFP record, which is a VF page. What needs to be created in order for the RFP record to be immediately displayed in Edit Mode, instead of displaying the Opportunity Detail screen after the RFP has been created?
1. Create a custom visualforce page using standard controller for creating and editing the record.
2. Override the 'Save' button in your visualforce page with your custom action.
3. Once user click the save button, then check the stage in the apex controller, if it matches then create the RFP record and redirect to the new record page.
Below is the sample page.
Apex class:
Visualforce:
public class OpptyRequestManagement {
public with sharing class opptySave {
private Opportunity oppty;
public opptySave(ApexPages.StandardController controller) {
oppty = (Opportunity)stdController.getRecord();
}
public PageReference save() {
if(oppty.StageName == '02 - Proposal'){
RFP_Request__c rfp = new RFP_Request__c();
//Logic to insert record
insert rfp;
PageReference acctPage = new ApexPages.StandardController(rfp).view();
acctPage.setRedirect(true);
return acctPage;
}
return null;
}
}
}
Any idea on how to fix this code so it does not error.
You also need to include logic to insert RFP record in the code