Saturday, September 22, 2018

i) Visualforce page on view account details and its related contacts, opportunities and open activities in tab by account id? ii) Create a button on account detail page?

i) Visualforce page on view account details and its related contacts, opportunities and open activities in tab by account id?
Visualforce Page:
---------------------
<apex:page standardController="account">
    <apex:tabPanel>
      <apex:tab label="Details" name="accountdetails" id="tabdetails">
          <apex:detail relatedList="false" title="false"/>
      </apex:tab>
        <apex:tab label="Contacts" name="Contacts" id="tabContacts">
          <apex:relatedList subject="{!account}" list="contacts" />
      </apex:tab>
        <apex:tab label="Opportunities" name="Opportunities" id="tabOpportunities">
          <apex:relatedList subject="{!account}" list="Opportunities"/>
      </apex:tab>
        <apex:tab label="Open Activities" name="OpenActivities" id="tabopnact">
          <apex:relatedList subject="{!account}" list="OpenActivities"/>
      </apex:tab>
    </apex:tabPanel>
</apex:page>


ii) Create a button on account detail page?
If we  create button, when user click on this button, can redirect to the visualforce we created above with out giving 'id' on URL.
Create new button:
fill the details:
Add this button on account detail page through page layout and it will show as below.

When we click on that button, it will open the vf page we create along with current account id.

No comments:

Post a Comment