Case

Represents a case, which is a customer issue or problem.

Supported Calls

create(), delete(), describeLayout(), describeSObjects(), getDeleted(), getUpdated(), query(), retrieve(), search(), undelete(), update(), upsert()

Fields

Field Details
AccountId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
ID of the account associated with this case.
CaseNumber
Type
string
Properties
Autonumber, Defaulted on create, Filter, idLookup, Sort
Description
Assigned automatically when each case is inserted. It can't be set directly, and it can't be modified after the case is created.
ClosedDate
Type
dateTime
Properties
Filter, Nillable, Sort
Description
The date and time when the case was closed.
CommunityId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
ID of the Community (Zone) associated with this case.

This field is available in API version 24.0 and later.

ConnectionReceivedId
Type
reference
Properties
Filter, Nillable
Description
ID of the PartnerNetworkConnection that shared this record with your organization. This field is only available if you have enabled Salesforce to Salesforce.
ConnectionSentId
Type
reference
Properties
Filter, Nillable
Description
ID of the PartnerNetworkConnection that you shared this record with. This field is only available if you have enabled Salesforce to Salesforce. Beginning with API version 15.0, the ConnectionSentId field is no longer supported. The ConnectionSentId field is still visible, but the value is null. You can use the new PartnerNetworkRecordConnection object to forward records to connections.
ContactId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
ID of the associated Contact.
CreatorFullPhotoUrl
Type
string
Properties
Filter, Group, Nillable, Sort
Description

URL of the user’s profile photo from the feed. Chatter Answers must be enabled to view this field. This field is available in API version 26.0 and later.

CreatorName
Type
string
Properties
Filter, Group, Nillable, Sort
Description

Name of the user who posted the question or reply. Only the first name of internal users (agents) appears to portal users in the feed. Chatter Answers must be enabled to view this field. This field is available in API version 26.0 and later.

CreatorSmallPhotoUrl
Type
string
Properties
Filter, Group, Nillable, Sort
Description

URL of the user’s thumbnail photo from the feed. Chatter Answers must be enabled to view this field. This field is available in API version 26.0 and later.

Description
Type
textarea
Properties
Create, Nillable, Update
Description
A text description of the case. Limit: 32 KB.
HasCommentsUnreadByOwner
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
Indicates whether a case has comments that have not yet been read by the owner (true) or not (false).
HasSelfServiceComments
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
Indicates whether a case has comments added by a Self-Service user (true) or not (false).
IsClosed
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
Indicates whether the case is closed (true) or open (false). This field is controlled by the Status field; it can't be set directly. Label is Closed.
IsClosedOnCreate
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
Indicates whether the case was closed at the same time that it was created (true) or not (false). This flag is read-only and is automatically set when a record is created. It can't be set to true unless the IsClosed flag is also true.
IsDeleted
Type
boolean
Properties
Defaulted on create, Filter
Description
Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted.
IsEscalated
Type
boolean
Properties
Create, Defaulted on create, Filter, Group, Sort, Update
Description
Indicates whether the case has been escalated (true) or not. A case's escalated state does not affect how you can use a case, or whether you can query, delete, or update it. However, you can't set this flag via the API. Label is Escalated.
IsSelfServiceClosed
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
Indicates whether the case is closed for Self-Service users (true) or not (false).
IsStopped
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
Indicates whether an entitlement process on a case is stopped (true) or not (false).
IsVisibleInSelfService
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
Indicates whether the case can be viewed in the Customer Service Portal, Partner Service Portal, and Self-Service Portal (true) or not (false). This field is applied for case visibility in the Partner Relationship Management, Customer Service Portal, and the earlier version of Self Service Portal. The field does not alter sharing and will not prevent usage of a direct URL to a case if a portal user has read or write access.
LastReferencedDate
Type
date
Properties
Filter, Nillable, Sort, Update
Description
The timestamp for when the current user last viewed a record related to this record.
LastViewedDate
Type
date
Properties
Filter, Nillable, Sort, Update
Description
The timestamp for when the current user last viewed this record. If this value is null, this record might only have been referenced (LastReferencedDate) and not viewed.
Origin
Type
picklist
Properties
Create, Filter, Group, Nillable,Sort, Update
Description
The source of the case, such as Email, Phone, or Web. Label is Case Origin.
OwnerId
Type
reference
Properties
Create, Defaulted on create, Filter, Group, Sort, Update
Description
ID of the contact who owns the case.
ParentId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The ID of the parent case in the hierarchy. The label is Parent Case.
Priority
Type
picklist
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The importance or urgency of the case, such as High, Medium, or Low.
QuestionId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The question in the answers community that is associated with the case. This field does not appear if you don't have an answers community enabled.
Reason
Type
picklist
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The reason why the case was created, such as Instructions not clear, or User didn’t attend training.
RecordTypeId
Type
reference
Properties
Create, Filter, Nillable, Update
Description
ID of the record type assigned to this object.
SlaStartDate
Type
dateTime
Properties
Create, Filter, Nillable, Update
Description
Shows the time the case entered an entitlement process. You can update or reset the time if you have the “Edit” permission on cases.

This field is available in API version 18.0 and later.

Status
Type
picklist
Properties
Create, Defaulted on create, Filter, Group, Nillable, Sort, Update
Description
The status of the case, such as “New,” “Closed,” or “Escalated.” This field directly controls the IsClosed flag. Each predefined Status value implies an IsClosed flag value. For more information, see CaseStatus.
StopStartDate
Type
dateTime
Properties
Filter, Nillable
Description
The date and time an entitlement process was stopped on the case.

This field is available in API version 18.0 and later.

Subject
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The subject of the case. Limit: 255 characters.
SuppliedCompany
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The company name that was entered when the case was created. can't be updated after the case has been created. Label is Company.
SuppliedEmail
Type
email
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The email address that was entered when the case was created. can't be updated after the case has been created. Label is Email.

If your organization has an active auto-response rule, SuppliedEmail is required when creating a case via the API. Auto-response rules use the email in the contact specified by ContactId. If no email address is in the contact record, the email specified here is used.

SuppliedName
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The name that was entered when the case was created. can't be updated after the case has been created. Label is Name.
SuppliedPhone
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The phone number that was entered when the case was created. can't be updated after the case has been created. Label is Phone.
Type
Type
picklist
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The type of case, such as Feature Request or Question.
Note
If you are importing Case data and need to set the value for an audit field, such as CreatedDate, contact Salesforce. Audit fields are automatically updated during API operations unless you request to set these fields yourself.

Usage

Use the Case object to manage cases for your organization. Client applications can query, update, and delete Attachment records associated with a case via the API.

Assignment Rules

When you query or update a case, your client application can have the case automatically assigned to one or more User records based on assignment rules that have been configured in the user interface. To use this feature, your client application needs to set either of the following options (but not both) in the AssignmentRuleHeader used in the create or update:

Field Field Type Details
assignmentRuleId reference ID of the assignment rule to use. Can be an inactive assignment rule. If unspecified and useDefaultRule is true, then the default assignment rule is used. To find the ID for a given assignment rule, query the AssignmentRule object (specifying RuleType="caseAssignment"), iterate through the returned AssignmentRule objects, find the one you want to use, retrieve its ID, and then specify its ID in this field in the AssignmentRuleHeader.
useDefaultRule boolean Specifies whether to use the default rule for rule-based assignment (true) or not (false). The default rule is assigned by users in the Salesforce user interface.

For a code example that shows setting the AssignmentRuleHeader for a Lead (which is similar to setting the AssignmentRuleHeader for a Case), see Lead.

Separating Accounts from Contacts in Cases

In releases before 8.0, the AccountId could not be specified, it was derived from the contact’s account. This behavior will continue to be supported in future releases, but you can also now specify an AccountId. If you do not specify the AccountId during the creation of a case, the value will default to the contact’s AccountId.

Note
When a record is updated, if the ContactId has not changed, then the AccountId is not regenerated. This prevents the API from overwriting a value previously changed in the Salesforce user interface. However, if an API call changes the ContactId and the AccountId field is empty, then the AccountId is generated using the contact’s account.

Using _case with Java

Depending on the development tool you use, you may need to write your application using _case instead of Case. This is because case is a reserved word in Java.

© Copyright 2000–2014 salesforce.com, inc. All rights reserved.
Various trademarks held by their respective owners.