• sdeveloper
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 16
    Replies

Hello, 

 

I am trying to show a related list on my visualforce tabbed Account page, and I want to show a Parent/Child account list.  I want to use the relatedlist code however I can't get it to work.  Does anyone know what it should say?  This is what i have:

 

<apex:tab label="Related Accounts" name="RelatedAccounts" id="tabRel">
  <apex:relatedList subject="{!account}" list="parent"  />
  
</apex:tab>

 

Hello, 

 

I am using panel grids to combine a few fields on my account detail page (this one is an example of the address field) however, I am having trouble getting it to align with the other fields.  I know that when I enlarge or shrink the size of the window, all the fields move dynamically however, my panel grids do not and instead hug the left side of the Account detail page.  Is there a way to get them to indent and also move dynamically?  

 

Here is me code:

 

<apex:pageblock mode="maindetail">  
    <apex:PageblockSection columns="2" >
        <apex:panelGrid columns="2" >
          <font color="#424242"><b>Coporate Address</b></font>
          <apex:panelGroup >
            <apex:panelGrid columns="1">
              <br>
            </br>
            <apex:outputText value="{!account.billingstreet}"/>
            <apex:panelGroup >
              <apex:outputText value="{!account.billingCity}, {!account.billingState} {!account.billingpostalcode}"/>
              <br></br>
            <apex:outputText value="{!account.billingcountry}"/>
          </apex:panelGroup>
        </apex:panelGrid>
      </apex:panelGroup>
    </apex:panelGrid>
</apex:pageblock>

 

 

 

Hello Everyone,

 

I've decided to make a dynamic layout for the Account Edit page along with a dynamic visualforce insert for the Account Detail.  Included in these layouts are two field sets I've created called "Employer"  and "Health Plan".    Basically how it works, is if 'Employer' is selected, the 'Employer' field set is displayed, and if 'Health Plan' is selected, then the 'Health Plan' field set is displayed.  

 

While that all works properly, I've discovered that if I use the salesforce page-layout editor to remove these fields from the general account Detail page, they also stop showing up in the field sets.  So if i want them to be shown on the Edit/Visualforce insert I have to have them at the bottom of the page.  Therefore, they are being shown twice.  Once in my visual force page insert, and also at the bottom of the general record.  Can someone help me so that this doesnt happen?

 

Here is the code for the Account Edit:  (there is obviously code for the rest of the fields in other pageblocksections but i deleted them out to keep this revelent)

 

<apex:page standardController="Account">
      <apex:form >
        <apex:pageBlock title="Account Edit">
              <apex:pageBlockButtons location="both">
                  <apex:commandButton value="Save" action="{!Save}"/>
                  <apex:commandButton value="Cancel" action="{!Cancel}" immediate="true"/>                                
              </apex:pageBlockButtons>
              
                      <apex:pageblocksection title="Account Type">
                      <apex:pageblocksectionitem >
                         <apex:actionRegion >
                          <apex:inputField value="{!Account.EmployerHealthPlan__c}">
                          <apex:actionSupport event="onchange" reRender="ajaxrequest"/>
                          </apex:inputField>
                         </apex:actionRegion>
                      </apex:PageBlockSectionItem>
                  </apex:PageblockSection>
                  
<apex:outputPanel id="ajaxrequest">   
                  <apex:pageBlockSection rendered="{!Account.EmployerHealthPlan__c=='Employer'}" columns="2">
                      <apex:repeat value="{!$ObjectType.Account.FieldSets.Employer}" var="field">
                       <apex:inputfield value="{!Account[field]}">
                        </apex:inputfield></apex:repeat>
                        
                        
                  </apex:pageBlockSection>
                  <apex:pageBlockSection rendered="{!Account.EmployerHealthPlan__c=='Health Plan'}" columns="2">
                                   
                      <apex:repeat value="{!$ObjectType.Account.FieldSets.HealthPlan}" var="field">
                       <apex:inputfield value="{!Account[field]}">  </apex:inputfield></apex:repeat>                    
               </apex:pageBlockSection>
              </apex:outputPanel>     
     
           </apex:pageblocksection>
      </apex:pageBlockSection>
      </apex:pageBlock>
      
</apex:form>
</apex:page>

 Here is the code for Account Detail:

 

<apex:page standardController="Account">
<apex:pageBlock >
                <apex:outputField value="{!Account.EmployerHealthPlan__c}"></apex:outputfield><br></br>
                <apex:outputPanel rendered="{!Account.EmployerHealthPlan__c == null}">No Health Plan recorded yet</apex:outputPanel>
                <apex:outputPanel id="ajaxrequest">   
                  <apex:pageBlockSection rendered="{!Account.EmployerHealthPlan__c=='Employer'}" columns="2">
                    <apex:repeat value="{!$ObjectType.Account.FieldSets.Employer}" var="f">
                       <apex:outputfield value="{!Account[f]}">
                        </apex:outputfield></apex:repeat>
                      
                  </apex:pageBlockSection>
                  <apex:pageBlockSection rendered="{!Account.EmployerHealthPlan__c=='Health Plan'}" columns="2">
                      <apex:repeat value="{!$ObjectType.Account.FieldSets.HealthPlan}" var="f">
                       <apex:outputfield value="{!Account[f]}">
                        </apex:outputfield></apex:repeat>                   
               </apex:pageBlockSection>
              </apex:outputPanel>     
    </apex:pageBlock>
</apex:page>

 

Hello,  I was hoping someone could help me with a problem I have.

 

I have a Visualforce insert being displayed on the general Account Detail page which includes a large amount of fields that change based on what is put in them.  For example: if someone selects Option A in the main drop-down, then only fields relating to A will show up on the VisualForce page.  

 

I've already re-rewitten the entire Account Edit page to allow for this to happen, except now my issue occurs on the detail page.  All of the fields I have involved in my VisualForce page are being displayed again in the general account page at the bottom.  If I remove the fields from the Saleforce's Page Layout editor the fields dissapear completely from my Account Edit page and my visualforce insert.  

 

Is there any way to remove them from the general detail page without affecting my VisualForce or Edit page?

Hello,

 

For the general Account Page, rather than writing the apex code out to recreate one section, I inserted a visualforce page in the layout.  This way I can have an entire section that changes based on pick-list values.  However, I want to remove those fields from the general layout (since they're on the Visualforce insert) but when I take them off, they dissapear from everywhere completely.  Is there a way to simply hide the fields or stop this from happening?  Or do I have to rewrite the code for the entire Account page?

 

 

I am able to get the tabbed layout on my accounts in Salesforce, however The entire body of the detail is now grey as well, and I would like it to be white still.  I've tried to add bgcolor commands but none of them seem to affect anything.  Can someone else me please?

 

<apex:page standardController="Account" showHeader="true" 
      tabStyle="account">
    <style>
.activeTab {background-color:#236FBD; 
                  color:white; 
                  tab-color:yellow;
                  background-image:none}
      .inactiveTab {background-color:white; 
                    color:black; 
                    background-image:none}
         
   </style>
   <apex:tabPanel switchType="client" selectedTab="tabdetails" 
                  id="AccountTabPanel" tabClass="activeTab" 
                  inactiveTabClass="inactiveTab">   
      <apex:tab label="Details" name="AccDetails" id="tabdetails">
         <apex:detail relatedList="false" title="true"/>
      </apex:tab>
      <apex:tab label="Contacts" name="Contacts" id="tabContact">
         <apex:relatedList subject="{!account}" list="contacts" />
      </apex:tab>
      <apex:tab label="Opportunities" name="Opportunities" 
                id="tabOpp">
         <apex:relatedList subject="{!account}" 
                           list="opportunities" />
      </apex:tab>
      <apex:tab label="Open Activities" name="OpenActivities" 
                id="tabOpenAct">
         <apex:relatedList subject="{!account}" 
                           list="OpenActivities" />
      </apex:tab>
      <apex:tab label="Notes and Attachments" 
                name="NotesAndAttachments" id="tabNoteAtt">
         <apex:relatedList subject="{!account}" 
                           list="NotesAndAttachments" />
      </apex:tab>
   </apex:tabPanel>
   
</apex:page>

 

Hello, 

 

I am trying to show a related list on my visualforce tabbed Account page, and I want to show a Parent/Child account list.  I want to use the relatedlist code however I can't get it to work.  Does anyone know what it should say?  This is what i have:

 

<apex:tab label="Related Accounts" name="RelatedAccounts" id="tabRel">
  <apex:relatedList subject="{!account}" list="parent"  />
  
</apex:tab>

 

Hello Everyone,

 

I've decided to make a dynamic layout for the Account Edit page along with a dynamic visualforce insert for the Account Detail.  Included in these layouts are two field sets I've created called "Employer"  and "Health Plan".    Basically how it works, is if 'Employer' is selected, the 'Employer' field set is displayed, and if 'Health Plan' is selected, then the 'Health Plan' field set is displayed.  

 

While that all works properly, I've discovered that if I use the salesforce page-layout editor to remove these fields from the general account Detail page, they also stop showing up in the field sets.  So if i want them to be shown on the Edit/Visualforce insert I have to have them at the bottom of the page.  Therefore, they are being shown twice.  Once in my visual force page insert, and also at the bottom of the general record.  Can someone help me so that this doesnt happen?

 

Here is the code for the Account Edit:  (there is obviously code for the rest of the fields in other pageblocksections but i deleted them out to keep this revelent)

 

<apex:page standardController="Account">
      <apex:form >
        <apex:pageBlock title="Account Edit">
              <apex:pageBlockButtons location="both">
                  <apex:commandButton value="Save" action="{!Save}"/>
                  <apex:commandButton value="Cancel" action="{!Cancel}" immediate="true"/>                                
              </apex:pageBlockButtons>
              
                      <apex:pageblocksection title="Account Type">
                      <apex:pageblocksectionitem >
                         <apex:actionRegion >
                          <apex:inputField value="{!Account.EmployerHealthPlan__c}">
                          <apex:actionSupport event="onchange" reRender="ajaxrequest"/>
                          </apex:inputField>
                         </apex:actionRegion>
                      </apex:PageBlockSectionItem>
                  </apex:PageblockSection>
                  
<apex:outputPanel id="ajaxrequest">   
                  <apex:pageBlockSection rendered="{!Account.EmployerHealthPlan__c=='Employer'}" columns="2">
                      <apex:repeat value="{!$ObjectType.Account.FieldSets.Employer}" var="field">
                       <apex:inputfield value="{!Account[field]}">
                        </apex:inputfield></apex:repeat>
                        
                        
                  </apex:pageBlockSection>
                  <apex:pageBlockSection rendered="{!Account.EmployerHealthPlan__c=='Health Plan'}" columns="2">
                                   
                      <apex:repeat value="{!$ObjectType.Account.FieldSets.HealthPlan}" var="field">
                       <apex:inputfield value="{!Account[field]}">  </apex:inputfield></apex:repeat>                    
               </apex:pageBlockSection>
              </apex:outputPanel>     
     
           </apex:pageblocksection>
      </apex:pageBlockSection>
      </apex:pageBlock>
      
</apex:form>
</apex:page>

 Here is the code for Account Detail:

 

<apex:page standardController="Account">
<apex:pageBlock >
                <apex:outputField value="{!Account.EmployerHealthPlan__c}"></apex:outputfield><br></br>
                <apex:outputPanel rendered="{!Account.EmployerHealthPlan__c == null}">No Health Plan recorded yet</apex:outputPanel>
                <apex:outputPanel id="ajaxrequest">   
                  <apex:pageBlockSection rendered="{!Account.EmployerHealthPlan__c=='Employer'}" columns="2">
                    <apex:repeat value="{!$ObjectType.Account.FieldSets.Employer}" var="f">
                       <apex:outputfield value="{!Account[f]}">
                        </apex:outputfield></apex:repeat>
                      
                  </apex:pageBlockSection>
                  <apex:pageBlockSection rendered="{!Account.EmployerHealthPlan__c=='Health Plan'}" columns="2">
                      <apex:repeat value="{!$ObjectType.Account.FieldSets.HealthPlan}" var="f">
                       <apex:outputfield value="{!Account[f]}">
                        </apex:outputfield></apex:repeat>                   
               </apex:pageBlockSection>
              </apex:outputPanel>     
    </apex:pageBlock>
</apex:page>

 

Hello,  I was hoping someone could help me with a problem I have.

 

I have a Visualforce insert being displayed on the general Account Detail page which includes a large amount of fields that change based on what is put in them.  For example: if someone selects Option A in the main drop-down, then only fields relating to A will show up on the VisualForce page.  

 

I've already re-rewitten the entire Account Edit page to allow for this to happen, except now my issue occurs on the detail page.  All of the fields I have involved in my VisualForce page are being displayed again in the general account page at the bottom.  If I remove the fields from the Saleforce's Page Layout editor the fields dissapear completely from my Account Edit page and my visualforce insert.  

 

Is there any way to remove them from the general detail page without affecting my VisualForce or Edit page?

Hello,

 

For the general Account Page, rather than writing the apex code out to recreate one section, I inserted a visualforce page in the layout.  This way I can have an entire section that changes based on pick-list values.  However, I want to remove those fields from the general layout (since they're on the Visualforce insert) but when I take them off, they dissapear from everywhere completely.  Is there a way to simply hide the fields or stop this from happening?  Or do I have to rewrite the code for the entire Account page?

 

 

I am able to get the tabbed layout on my accounts in Salesforce, however The entire body of the detail is now grey as well, and I would like it to be white still.  I've tried to add bgcolor commands but none of them seem to affect anything.  Can someone else me please?

 

<apex:page standardController="Account" showHeader="true" 
      tabStyle="account">
    <style>
.activeTab {background-color:#236FBD; 
                  color:white; 
                  tab-color:yellow;
                  background-image:none}
      .inactiveTab {background-color:white; 
                    color:black; 
                    background-image:none}
         
   </style>
   <apex:tabPanel switchType="client" selectedTab="tabdetails" 
                  id="AccountTabPanel" tabClass="activeTab" 
                  inactiveTabClass="inactiveTab">   
      <apex:tab label="Details" name="AccDetails" id="tabdetails">
         <apex:detail relatedList="false" title="true"/>
      </apex:tab>
      <apex:tab label="Contacts" name="Contacts" id="tabContact">
         <apex:relatedList subject="{!account}" list="contacts" />
      </apex:tab>
      <apex:tab label="Opportunities" name="Opportunities" 
                id="tabOpp">
         <apex:relatedList subject="{!account}" 
                           list="opportunities" />
      </apex:tab>
      <apex:tab label="Open Activities" name="OpenActivities" 
                id="tabOpenAct">
         <apex:relatedList subject="{!account}" 
                           list="OpenActivities" />
      </apex:tab>
      <apex:tab label="Notes and Attachments" 
                name="NotesAndAttachments" id="tabNoteAtt">
         <apex:relatedList subject="{!account}" 
                           list="NotesAndAttachments" />
      </apex:tab>
   </apex:tabPanel>
   
</apex:page>