Closing sub tab and refreshing primary tab

I was working in this scenario, I did not see any snippets available in the community. Thought I would give a try and make it to work. I was successful to do it so. Let me give you guys a working code which might help you to save a lot of time.

Hope it helps.

Components:
1) JS button for Account layout
2) VF page
3) Controller

Scenario:
• When user opens a account record in a servicer console. It will open the record in a primary tab.
• There will be a detail page button which will host a VF page with custom control
• VF page will do some DML operations on SF objects including Account
• Now when user clicks a button in the VF page, then the VF page(SubTab) should close and Account Page(PrimaryTab) should refresh to show the updated data.

Code snippets

JS Button:
VF page:
Controller:

Comments

  1. Hello Pradeep,

    My name is Sudheer and need your help can you please email me at skondamuri@gmail.com

    Thanks

    Sudheer

    ReplyDelete
  2. Just curious what if i have to use NavigatetoURL(External) with similar approach

    ReplyDelete
  3. Hi,
    i need help on this which im doing similar task....please
    contact me email-srishapyati4@gmail.com

    ReplyDelete

Post a Comment