1

When we click on a item in the related list it takes us to that item record. But there is no way to come back to the page we clicked this link from. This works when you click on the new button which has a returl specified.

Is there a way when someone clicks on the link on the related list record and it has a cancel/back button to return back to page we clicked this link from?

enter image description here

2 Answers 2

3

Can you simply add a custom Javascript button to "Invoices Service" page layout that'd have

history.back()
// or history.go(-1)
// or location.href = '/{!Invoice_Service__c.Invoice__c}';
// or same but with button type URL and not JS
// or if you really want - do something fancy with "Recent Items"?

Call the button "back to Invoice" or something?

Other than that - I guess you'd have to override view action with VF page, maybe even display <apex:detail> to salvage normal layout but do some crazy stuff in the controller... Not worth the effort I'd say.

Or teach your users about the "back" button in the browser, what happens when they click the lookup to "Invoice" etc ;) I'm not usability expert but I'd say you should have a good reason to make custom buttons like that ;)

P.S. I've also seen a project where they had very complex hierarchical data structure and they decided to implement kind of path on the top of the page (I think it's called "breadcrumbs").

1
  • agree VF is a bit of overkill for this. Would then need to implement for all the related lists. javascript with histroy should be worth the try.
    – Prady
    Jan 18, 2013 at 8:01
1

You can create a new VF page and override this VF for 'View' button. In the vf page , you have to use java script to open the related salesforce native page and along with you can specify the return url.

for return url, use below code:

var referrer = document.referrer; alert(referrer);

This will give you the parent window address. So , when you will click on 'Cancel' button , you will come back to parent page.

You must log in to answer this question.

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