0

First of all let me explain why i am doing this..

my client do not want Action column (EDIT/DELETE) in related list so, i developed one visualforce and override it to original page layout..

Here is my code :

<apex:page standardController="Bundle__c">
    <style type="text/css">
        .actionColumn {display:none; visibility:hidden}
    </style>   
    <apex:detail subject="{!Bundle__c.Id}" relatedList="false"/>
    <apex:relatedList list="Product_Quantities__r" title="Product List"/>
</apex:page>

Now, I created one CUSTOM LIST BUTTON in my custom object (Product_Quantities__c) because once user going to click on Save button then it will auto redirect to the parent record (Bundle__c)

Code of CUSTOM LIST BUTTON :

window.location="/a0c/e?CF00N21000000jtT8={!Bundle__c.Name}&CF00N21000000jtT8_lkid={!Bundle__c.Id}&retURL={!Bundle__c.Id}&saveURL=%2F{!Bundle__c.Id}"

How to return with original visualforce page which is shown below :

/apex/BundlePageLayout?id={Bundle__c.Id}

Can anyone look into this issue and tell me what mistake or what anything else need in this ?

  • I think this is standard behaviour. If you go to Account and then to Contact related list, if you click on new contact and click save, it will redirect you to the standard contact detail page and NOT to the Account page from where you came. For this, you should also develop and page for Product Quantities and redirect the user on Save to the parent record which is super easy to do. – Shailesh Patil Jan 3 '17 at 11:37
  • @ShaileshPatil We can override this standard behavior with URL Hack and of course we can land to our parent record..but in this case i stuck with the visualforce page – HSdev Jan 3 '17 at 11:43
1

Got the solution with lots of r & d :)

Just need to add visualforce page url in saveURL

window.location="/a0c/e?CF00N21000000jtT8={!Bundle__c.Name}&CF00N21000000jtT8_lkid={!Bundle__c.Id}&saveURL=/apex/BundlePageLayout?id={!Bundle__c.Id}&retURL=%2F{!Bundle__c.Id}"

Hope this will help others if issue raised !!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.