Find your content:

Search form

You are here

Exposing the contract object in the customer portal


I have a customer portal where we expose different types of records to users who need to see only records that belong to the same Account as theirs. The portal is built using Visualforce pages and a site completely overriding the native portal.

As of now I am achieving this using profiles and sharing settings that come with high volume customer portal user licenses.

I will also need to display CONTRACT (standard object) records to users authorized to see them. When I try to assign security to Contracts, I see its not directly possible. I saw that the Account object security page lists Contracts at the field level. My user's profile has access to this.

Now I am trying to display a link conditionally using the code:

                <apex:variable var="contact_var" rendered="{!$ObjectType.Contract.accessible}" value="Contract">
                    <li><a href="#" id="contractsnav">CONTRACTS</a></li>  

But this link does not appear which means that the user does not have access to CONTRACTS. What am I missing here? Can we display CONTRACT records in a customer portal? And what needs to be done so that portal users can see those records.

Thank you.

Attribution to: Richard N

Possible Suggestion/Solution #1

Unfortunately Contracts are not accessible through Customer Portal. You can create a second, custom, object and essentially persist duplicate information of the Contract to this custom object. By creating essentially a duplicate object type, you can expose that object type to the customer portal. Here is a blog post regarding it.

Attribution to: Michael Welburn

Possible Suggestion/Solution #2

Can you try some kind of last resort before going with @MichaelWelburn's answer...

Recently I had to create an "admin panel" for our power users that would let them submit many different batch jobs (less work for IT). I wanted to display status of past jobs (data from AsyncApexJob table). For the life of me I couldn't get it to work, page was throwing "insufficient privileges" when I was logged in as non-SysAdmin user. Even though profile had rights to both page and controller.

Long story short:

  1. Use debug logging to check if query for Contracts actually returns something on the Portal page.
  2. If it does - construct a helper ContractWrapper class which would hold Strings, Ids, Date fields etc. You need to stupidly painstakingly copy over the values from fields, simple member variable Contract won't work.
  3. Create a list of these and SF should allow you to display it in <apex:dataTable /> etc. like any other query result.

It's a tiny ray of hope and I have no idea if it won't be closed up in future... but it worked for me so maybe can work on the Portal too.

Attribution to: eyescream

Possible Suggestion/Solution #3

You can turn on Entitlement Management Setup --> Customize --> Entitlement Management.

This will allow you to use "Service Contracts" which can be accessed from the Customer Portal.

They are very similar to Contracts, but allow you to associate entitlements and enforce SLAs.

Attribution to: Sami Ellong
This content is remixed from stackoverflow or stackexchange. Please visit

My Block Status

My Block Content