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
DevelopersDevelopers 

How to populate the account information in the case object as a related list?

Hi,

In case object, there is a lookup relation from case to account is available. I need to populate the account details on case related list when the case is created for that account. Case details are populated in the accout related list on account object page layout. But, the same thing when i am trying add the account as a related list to the case, it is not available.

Please suggest me how to populate the account information on case page layout in a related list?

 

Regards,

Kumar

Best Answer chosen by Admin (Salesforce Developers) 
Dhaval PanchalDhaval Panchal

Create one apex page as below.

 

<apex:page standardController="Case">
    <!--<apex:detail title="Account" relatedList="false" showChatter="false" inlineEdit="false" relatedListHover="true" subject="{!Case.Account}" />-->
    <apex:form>
        <apex:pageBlock>
            <table cellspacing="0" cellpadding="0" width="100%" height="100%" class="list">
                <tr class="headerRow">
                    <th>
                        {!$ObjectType.Account.fields.Name.label}
                    </th>
                    <th>
                        {!$ObjectType.Account.fields.BillingState.label}
                    </th>
                    <th>
                        {!$ObjectType.Account.fields.Type.label}
                    </th>
                    <th>
                        {!$ObjectType.Account.fields.Phone.label}
                    </th>
                </tr>
                <tr class="dataRow" onmouseover="if (window.hiOn){hiOn(this);}" onmouseout="if (window.hiOff){hiOff(this);}" onfocus="if (window.hiOn){hiOn(this);}" onblur="if (window.hiOff){hiOff(this);}">
                    <td class="dataCell">
                        <apex:outputLink value="\{!Case.AccountId}">{!Case.Account.Name}</apex:outputLink>
                    </td>
                    <td class="dataCell">
                        {!Case.Account.BillingState}
                    </td>
                    <td class="dataCell">
                        {!Case.Account.Type}
                    </td>
                    <td class="dataCell">
                        {!Case.Account.Phone}
                    </td>
                </tr>
            </table>    
        </apex:pageBlock>
    </apex:form>
</apex:page>

 and add this page to case detail page layout.

 

it will show like below snap.

 

https://docs.google.com/file/d/0B6cPMtpRoi9FVnE5eUNNMlc5cjQ/edit?usp=sharing

 

Are you want to same or what?

All Answers

Dhaval PanchalDhaval Panchal
Means you want Account related list on Case page layout?
DevelopersDevelopers

Dhaval PanchalDhaval Panchal
Its not possible, but you can create custom inline page for that.
Dhaval PanchalDhaval Panchal

Create one apex page as below.

 

<apex:page standardController="Case">
    <!--<apex:detail title="Account" relatedList="false" showChatter="false" inlineEdit="false" relatedListHover="true" subject="{!Case.Account}" />-->
    <apex:form>
        <apex:pageBlock>
            <table cellspacing="0" cellpadding="0" width="100%" height="100%" class="list">
                <tr class="headerRow">
                    <th>
                        {!$ObjectType.Account.fields.Name.label}
                    </th>
                    <th>
                        {!$ObjectType.Account.fields.BillingState.label}
                    </th>
                    <th>
                        {!$ObjectType.Account.fields.Type.label}
                    </th>
                    <th>
                        {!$ObjectType.Account.fields.Phone.label}
                    </th>
                </tr>
                <tr class="dataRow" onmouseover="if (window.hiOn){hiOn(this);}" onmouseout="if (window.hiOff){hiOff(this);}" onfocus="if (window.hiOn){hiOn(this);}" onblur="if (window.hiOff){hiOff(this);}">
                    <td class="dataCell">
                        <apex:outputLink value="\{!Case.AccountId}">{!Case.Account.Name}</apex:outputLink>
                    </td>
                    <td class="dataCell">
                        {!Case.Account.BillingState}
                    </td>
                    <td class="dataCell">
                        {!Case.Account.Type}
                    </td>
                    <td class="dataCell">
                        {!Case.Account.Phone}
                    </td>
                </tr>
            </table>    
        </apex:pageBlock>
    </apex:form>
</apex:page>

 and add this page to case detail page layout.

 

it will show like below snap.

 

https://docs.google.com/file/d/0B6cPMtpRoi9FVnE5eUNNMlc5cjQ/edit?usp=sharing

 

Are you want to same or what?

This was selected as the best answer
DevelopersDevelopers