function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Matthew AllenMatthew Allen 

Basic visualforce help please

Hi,

I want to add a Visualforce section to an account page that is 5 rows high and 4 columns wide and all it needs to do is pull in the 20 fields needed.

          Field Name                      Field Name                                                        Field Name                     Field Name
          Field Name                      Field Name                                                        Field Name                     Field Name
          Field Name                      Field Name                                                        Field Name                     Field Name
          Field Name                      Field Name                                                        Field Name                     Field Name
          Field Name                      Field Name                                                        Field Name                     Field Name

Can you help write this for me? I feel it should be really easy, but I am really struggling to understand it all.

Thanks

Matt
Matthew AllenMatthew Allen
Also, Columns 2 and 4 to have a Font size of 20.
Suresh(Suri)Suresh(Suri)
Hi Allen,

You can try using html table with tr,td inside apex:input fields like this way

User-added image

 
Matthew AllenMatthew Allen
thanks for your help, but I think thats confused me more! :)
Suresh(Suri)Suresh(Suri)
Is your requirement like this?

User-added image
Matthew AllenMatthew Allen
yes! how does the code end? also, I will be refrencing formula fields so how can I make the font larger?

Thanks so much for your help.
Ajay K DubediAjay K Dubedi
Hi Allen,
Use this code and format and it will help you. I have created only 4 fields in Account but in this format you complete your page.
Visualforce Page:-
<apex:page standardController="Account" extensions="AccountExample">
  <apex:form >
    <apex:pageBlock title="Inline Visualforce Page Example">
       <table>
         <apex:repeat value="{!AccList}" var="a" >
           <tr>
             <td>Id</td>
               <td>{! a.Id}</td>
                <td style="font-size:20px;">Name</td>
                  <td style="font-size:20px;">{! a.Name}</td>
                    <td>Phone</td>
                      <td>{! a.phone}</td>
                        <td style="font-size:20px;">Website</td>
                       <td style="font-size:20px;">{! a.Website}</td>
                   </tr>
               </apex:repeat>
           </table>
        </apex:pageBlock>
   </apex:form>
</apex:page>
Extension Class:
   public class AccountExample{
   public String accId{get;set;}
    public List<Account> AccList{get;set;}
    public AccountExample(ApexPages.StandardController controller){
       accId = ' ';
       accId=System.currentPageReference().getParameters().get('id');
       System.debug('...................accId=='+accId);
       Id i= Id.valueOf(accId);
       AccList = [Select Id, Name, Site, AccountSource, BillingAddress, Phone, Rating,ShippingAddress,Type,Website,YearStarted from Account where Id=:i];
       System.debug('.............................AccList=='+AccList);
   }
    public AccountExample(){
    }
 }
After this you will see this example and it will help you for making Inline Page for Account.
https://developer.salesforce.com/forums?id=9060G000000IBV9QAO
You follow the same step for Account in step 2.

Output:


User-added image

Regards,
Ajay
Matthew AllenMatthew Allen
Hi Ajay,

Thanks for taking the time to do this. One of the fields I am referencing is a formula field that references a static image. Using your method just displays the image address, not the image itself? How can I get round that?
Also, after the 4 fields, how do I then move down a row so I can have another 4 underneath?

Thanks again

Matt
Matthew AllenMatthew Allen
Suresh, Thanks so much for your input also. How can I hide the field lables? I have read that <apex:inputField value= should do it like you have stated but it isn't working?

Thanks

Matt
Suresh(Suri)Suresh(Suri)
Hi Allen,

Try this link may be it will help
https://success.salesforce.com/answers?id=90630000000hmVbAAI

Thanks 
Suresh
Suresh(Suri)Suresh(Suri)
OR try without lable
<apex:page controller="InsertDynamicSobjectController">
    <apex:form >
        <apex:pageBlock >

            <apex:pageBlockSection >

                <apex:pageBlockSectionItem >
                    <apex:inputField value="{!YourStateField}"/>
                </apex:pageBlockSectionItem>

            </apex:pageBlockSection>

        </apex:pageBlock>
    </apex:form>
</apex:page>

 
Suresh(Suri)Suresh(Suri)
Hi Allen,

Just i have tried like this is this you are looking?see below simple code

User-added image
<apex:page standardController="Account" sidebar="false">
<apex:form >
<apex:pageblock >
<apex:pageblockSection columns="4">

<apex:pageBlockSectionItem >
<label class="dollor">PhoneNumber</label>
<apex:inputField value="{!Account.Phone}"/>
</apex:pageBlockSectionItem>

<apex:pageBlockSectionItem >
<label class="dollor" style="font-size:20px;">PhoneNumber</label>
<apex:inputField value="{!Account.Phone}"/>
</apex:pageBlockSectionItem>

<apex:pageBlockSectionItem >
<label class="dollor">PhoneNumber</label>
<apex:inputField value="{!Account.Phone}"/>
</apex:pageBlockSectionItem>

<apex:pageBlockSectionItem >
<label class="dollor" style="font-size:20px;">PhoneNumber</label>
<apex:inputField value="{!Account.Phone}"/>
</apex:pageBlockSectionItem>


<apex:pageBlockSectionItem >
<label class="dollor">PhoneNumber</label>
<apex:inputField value="{!Account.Phone}"/>
</apex:pageBlockSectionItem>

<apex:pageBlockSectionItem >
<label class="dollor" style="font-size:20px;">PhoneNumber</label>
<apex:inputField value="{!Account.Phone}"/>
</apex:pageBlockSectionItem>

<apex:pageBlockSectionItem >
<label class="dollor">PhoneNumber</label>
<apex:inputField value="{!Account.Phone}"/>
</apex:pageBlockSectionItem>

<apex:pageBlockSectionItem >
<label class="dollor" style="font-size:20px;">PhoneNumber</label>
<apex:inputField value="{!Account.Phone}"/>
</apex:pageBlockSectionItem>


<apex:pageBlockSectionItem >
<label class="dollor">PhoneNumber</label>
<apex:inputField value="{!Account.Phone}"/>
</apex:pageBlockSectionItem>

<apex:pageBlockSectionItem >
<label class="dollor" style="font-size:20px;">PhoneNumber</label>
<apex:inputField value="{!Account.Phone}"/>
</apex:pageBlockSectionItem>

<apex:pageBlockSectionItem >
<label class="dollor">PhoneNumber</label>
<apex:inputField value="{!Account.Phone}"/>
</apex:pageBlockSectionItem>

<apex:pageBlockSectionItem >
<label class="dollor" style="font-size:20px;">PhoneNumber</label>
<apex:inputField value="{!Account.Phone}"/>
</apex:pageBlockSectionItem>


<apex:pageBlockSectionItem >
<label class="dollor">PhoneNumber</label>
<apex:inputField value="{!Account.Phone}"/>
</apex:pageBlockSectionItem>

<apex:pageBlockSectionItem >
<label class="dollor" style="font-size:20px;">PhoneNumber</label>
<apex:inputField value="{!Account.Phone}"/>
</apex:pageBlockSectionItem>

<apex:pageBlockSectionItem >
<label class="dollor">PhoneNumber</label>
<apex:inputField value="{!Account.Phone}"/>
</apex:pageBlockSectionItem>

<apex:pageBlockSectionItem >
<label class="dollor" style="font-size:20px;">PhoneNumber</label>
<apex:inputField value="{!Account.Phone}"/>
</apex:pageBlockSectionItem>


<apex:pageBlockSectionItem >
<label class="dollor">PhoneNumber</label>
<apex:inputField value="{!Account.Phone}"/>
</apex:pageBlockSectionItem>

<apex:pageBlockSectionItem >
<label class="dollor" style="font-size:20px;">PhoneNumber</label>
<apex:inputField value="{!Account.Phone}"/>
</apex:pageBlockSectionItem>

<apex:pageBlockSectionItem >
<label class="dollor">PhoneNumber</label>
<apex:inputField value="{!Account.Phone}"/>
</apex:pageBlockSectionItem>

<apex:pageBlockSectionItem >
<label class="dollor" style="font-size:20px;">PhoneNumber</label>
<apex:inputField value="{!Account.Phone}"/>
</apex:pageBlockSectionItem>

</apex:pageblockSection>
</apex:pageblock>
</apex:form>  
</apex:page>

If this anwer correct plz mark as best answer
Ajay K DubediAjay K Dubedi
Hi Allen,

When you create new row you use <tr>..</tr> and  In Static Image i use formula field and formula is:-
IF(static_image_check_box__c , IMAGE("/resource/true_condition","",15,40) , IMAGE("/resource/false_condition","",15,40))
So you use this code-
In line no. 31-32  line used to show the image.
Visualforce Page:-
<apex:page standardController="Account" extensions="AccountExample">
   <apex:form >
       <apex:pageBlock title="Inline Visualforce Page Example">
           <table border="0px">
               <apex:repeat value="{!AccList}" var="a" >
                   <tr>
                       <td>Id</td>
                       <td>{! a.Id}</td>
                       <td style="font-size:20px;">Name</td>
                       <td style="font-size:20px;">{! a.Name}</td>
                       <td>Phone</td>
                       <td>{! a.phone}</td>
                       <td style="font-size:20px;">Website</td>
                       <td style="font-size:20px;">{! a.Website}</td>
                   </tr>
                   <tr>
                       <td>Rating</td>
                       <td>{! a.Rating}</td>
                       <td style="font-size:20px;">Fax</td>
                       <td style="font-size:20px;">{! a.Fax}</td>
                       <td>YearStarted</td>
                       <td>{! a.YearStarted}</td>
                       <td style="font-size:20px;">Website</td>
                       <td style="font-size:20px;">{! a.Website}</td>
                   </tr>
                   <tr>
                       <td>ShippingCity</td>
                       <td>{! a.ShippingCity}</td>
                       <td style="font-size:20px;">ShippingStreet</td>
                       <td style="font-size:20px;">{! a.ShippingStreet}</td>
                       <td>Static Image</td>
                       <td><apex:outputText value="{!a.static_image__c}" escape="false"/></td>
                       <td style="font-size:20px;">static image check box</td>
                       <td style="font-size:20px;">{! a.static_image_check_box__c}</td>
                   </tr>
                   <tr>
                       <td>ShippingCountry</td>
                       <td>{! a.ShippingCountry}</td>
                       <td style="font-size:20px;">Name</td>
                       <td style="font-size:20px;">{! a.Name}</td>
                       <td>Phone</td>
                       <td>{! a.phone}</td>
                       <td style="font-size:20px;">Website</td>
                       <td style="font-size:20px;">{! a.Website}</td>
                   </tr>
                   <tr>
                       <td>Id</td>
                       <td>{! a.Id}</td>
                       <td style="font-size:20px;">Name</td>
                       <td style="font-size:20px;">{! a.Name}</td>
                       <td>Phone</td>
                       <td>{! a.phone}</td>
                       <td style="font-size:20px;">Website</td>
                       <td style="font-size:20px;">{! a.Website}</td>
                   </tr>
               </apex:repeat>
           </table>
        </apex:pageBlock>
   </apex:form>
</apex:page>
Extension:-
public class AccountExample {
public String accId {get;set;}
public List<Account> AccList {get;set;}
public AccountExample(ApexPages.StandardController controller){
       accId = '';
       accId=System.currentPageReference().getParameters().get('id');
       System.debug('...................accId=='+accId);
       Id i= Id.valueOf(accId);
AccList = [Select Id, Name, Site, AccountSource, BillingAddress, NumberOfEmployees, Phone, Rating, static_image__c, static_image_check_box__c, ShippingCity, ShippingStreet, ShippingState, ShippingPostalcode ,ShippingCountry, Type, Website, Fax, YearStarted from Account where Id=:i];
System.debug('.............................AccList=='+AccList);
   }
public AccountExample(){
    }
}
Output:-

User-added image

Hope it will help you…
Regards,
Ajay

 
Matthew AllenMatthew Allen
Hi Ajay,

Thanks for you input but I don't fully understand it. Do I put the IF formula inbetween line 31&32?