0

I created a VF page that the opportunity owner is directed to when they click on an opportunity and they are the opportunity owner. The page just asks the user simple compliance questions and does an insert on the opportunity. Once the VF is submitted then they are directed to the opportunity. It's working fine but we send out emails to SF users with links to the opportunities. Below are the different possible URL’s, all of these should behave the same… which is to say if you are the owner, you get the dialog, and if you are a non-owner you don’t get the dialog.

(A) Resulting link when owner clicks opp in SF. This link shows the dialog to all users. (not only opportunity owners) https://testval--c.cs87.visual.force.com/apex/ExportCheckPage1?oppId=00620000009T2ZUAA0

(B) Resulting link when non owner clicks the opp in SF. This link does not show the dialog to any user. https://testval.cs87.my.salesforce.com/00620000009T2ZUAA0?nooverride=1

(C) When you edit the URL to change 1 to 0 on the end of (B). Acts exactly like (B) as far as I can tell. https://testval.cs87.my.salesforce.com/00620000009T2ZUAA0?nooverride=0

(D) When you edit the URL to remove the “nooveride=1” from the end of (B). Redirects you back to (A) or (B), so this link is probably irrelevant. https://testval.cs87.my.salesforce.com/00620000009T2ZUAA0

Here's the link to the code: Certain Opportunity Owners are hung up on VisualForce page

How can I get consistant behavior out of the URLs? And how would I go about having it where the user can't edit the URL to get past the compliance page?

Thank you in advance!

8
  • I guess people are sick of my questions. lol I've about figured out all my issues with this VF page, this is the last one. Commented Feb 5, 2016 at 15:23
  • So every time I open an opportunity as an owner, I'm presented with a list of compliance questions I must answer? Commented Feb 5, 2016 at 15:33
  • @BradleyDelaune not everytime. Only the first time the opp is opened to answer if the opp is compliant, then the opp owner won't see it again. Commented Feb 5, 2016 at 16:54
  • So as a user, how will I know if the Opportunity is compliant without seeing the opportunity first? I think this is more than a technology issue, it sounds like the process needs a small modification. I would explore other options beyond trying to override the View action. Maybe something that prevents editing (or changing the status of) an opportunity without those questions being asked. Say, provide a button on the opportunity called "Verify Compliance" that brings to VF page. Also create a Validation rules that prevents editing until that is completed. Just a few ideas... Commented Feb 5, 2016 at 17:02
  • 1
    Fair enough. I hate it when management doesn't consult IT first... You're going to have issues because the only way to intercept viewing an Opportunity is by overriding the View page, but as a user I could always say ?nooverride=1 The only thing I can suggest is to keep what you have and add a validation rule that prevents any editing until the compliance is accepted. That way if a user does attempt to bypass, they won't be able to do much. Commented Feb 5, 2016 at 17:23

1 Answer 1

0

what i will suggest you is take user to asinge page and take opp Id in parameter now in that page decide if current user is owner then redirect them to model page and if they are not owner redirect them to simple page.

if now user can't edit the link and you havve complete control where you want to redirect to user.

This method will also give you one benefit if in future you want to replace your custom model page with another page and then you can easily change but your old emails link will still remain valid.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .