• Jessica L
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies

Is there a way to redirect a user to an Account Page Layout based on logic in Apex code? There is a clear path to redirect to a VisualForce page, but I do not want to recreate the various Account Page Layouts in VisualForce.

 

I have read that you can include VisualForce elements in a Page layout, but I am either looking to redirect from the Apex code to a page layout or include a Page Layout in a VisualForce page (without recoding the PageLayout in VisualForce markup).

 

I realize that I can use profiles to direct a user to different Page Layouts, but I need more granular control than a profile will provide, hence the apex code.

 

Is there a way to redirect a user to an Account Page Layout based on logic in Apex code? There is a clear path to redirect to a VisualForce page, but I do not want to recreate the various Account Page Layouts in VisualForce.

 

I have read that you can include VisualForce elements in a Page layout, but I am either looking to redirect from the Apex code to a page layout or include a Page Layout in a VisualForce page (without recoding the PageLayout in VisualForce markup).

 

I realize that I can use profiles to direct a user to different Page Layouts, but I need more granular control than a profile will provide, hence the apex code.

 

I have an approval process that has two requirements that I cannot satisfy with a standard SFDC approval process:

 

1) If the approval is rejected at any step, the approver needs to update two fields on Opportunity:  a rejection reason (picklist) and detail (long text field).

2) Upon final approval, the approver needs to update two fields (text and email) on the Opportunity.

 

In both cases, these actions are mandatory.  I have found no way - back door or otherwise - to place editable fields (other than Comments) on the Approval page layout.  The approver/rejector is obviously thrown onto the Opportunity detail page upon approval/rejection, but there's no way to force them - or even draw their attention to - the fields they need to update.  Nor is there any way, with standard Approval processes, to have a different Approval page layout for different approvers.

 

My current workaround is pretty ugly.  Upon rejection, a Workflow sends an email to the rejector.  The email contains a link to an Apex page that contains relevant Opportunity fields, with the rejection reason and detail fields editable and mandatory.  Upon final approval, a Workflow sends an email to the approver.  The email contains a link to an Apex page that contains relevant Opportunity fields, with the two required fields editable and mandatory.  So approvers get an email inviting them to approve, they click into the Approval page, select approve or reject, then receive ANOTHER email inviting them to click into ANOTHER page to provide required fields.  Ick.  And there's no way to force them to click the link to update the required fields, so there also have to be time-based reminders.

 

I want to have the audit trail of a real Approval process, with a related list of Approval steps on the Opportunity, so I'm left with the "opportunity" to create a completely custom approval process.  I've done custom Approval submission and creation, but would really prefer NOT to have to create the whole things from scratch, end-to-end.

 

So my question is this: has anyone got clever ideas for how I can do any or all of the following:

 

A) Put editable (mandatory, if at all possible) fields on an Approval page layout

B) Have different Approval page layouts for different approvers

C) Control page redirection upon approval/rejection

 

 

Thanks,

Ken