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
charleshowardcharleshoward 

Problem setting EntitlementId on Case

Hello,

 

We have Entitlements turned on in a Sandbox environment.  In the Case object there is now a standard field labeled "Entitlement Name", with an API name of "Entitlement".  I've upgraded Eclipse to the latest version, and deleted and re-created my project for the Sandbox environment.

 

I'm trying to pull the Entitlement lookup field into a custom VisualForce page for editing Case records.  The Page uses the Standard Controller with an Extension.  When I add an apex:inputField like this:

 

  <apex:pageBlockSection>

    <apex:inputField value="{!Case.EntitlementId}"/>

  </apex:pageBlockSection>



I get an error message saying "Invalid field EntitlementId for SObject Case"

 

If I go into the Extension, and bring up the autofill list of fields on the private final Case record "EntitlementId" shows up as an available field.  However, if I try to do something to test it's accessibility like:

 

cse.EntitlementId = null;

 

Then I get the same error message saying that EntitlementId is not a valid field for Case.

 

I tried creating the Trigger that is provided in this post: http://wiki.developerforce.com/page/Default_Entitlement_on_Case_with_Triggers and I didn't get an error from it.

 

Does anyone have any idea what's going on here?  I'm inclined to think it's an Eclipse issue, but I'm not sure....

charleshowardcharleshoward

I figured it out.  I assumed that when I upgraded the project in Eclipse to the new version it would update the API versions of all of it's classes and things, but it doesn't .  The Entitlement field on Case is only available in API version 18 or later, and since I originally created the Page and Extension in 2009, they were both at version 14.  

 

I updated the API version of the Page and the Extension through the SF interface, (Setup > Develop > Apex Classes > Edit > Version Settings)  and everything works now.