Case

Represents a case, which is a customer issue such as a customer’s feedback, problem, or question.

Supported Calls

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

Fields

Field Field Type Field Properties Description
AccountId reference Create

Filter

Nillable

Update

ID of the account associated with this Case. For information about specifying this value, see Separating Accounts from Contacts in Cases.
CaseNumber string Autonumber

Defaulted on create

Filter

idLookup

Assigned automatically when each case is inserted. It cannot be set directly, and it cannot be modified after the case is created.
ClosedDate dateTime Filter

Nillable

The date and time when the case was closed.
ContactId reference Create

Filter

Nillable

Update

ID of the associated Contact. For information on IDs, see ID Field Type.
Description textarea Create

Nillable

Update

A text description of the case. Limit: 32 KB.
HasCommentsUnreadByOwner boolean Defaulted on create

Filter

Indicates whether a case has comments that have not yet been read by the owner (true) or not (false).
HasSelfServiceComments boolean

Defaulted on create

Filter

Indicates whether a case has comments added by a Self-Service user (true) or not (false).
IsClosed boolean Defaulted on create

Filter

Indicates whether the case is closed (true) or open (false). This field is controlled by the Status field; it cannot be set directly. Label is Closed.
IsClosedOnCreate boolean Defaulted on create

Filter

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 upon create(). It cannot be set to true unless the IsClosed flag is also true.
IsDeleted boolean Defaulted on create

Filter

Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted.
IsEscalated boolean Create

Defaulted on create

Filter

Update

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(), update(), or delete() it. However, you cannot set this flag via the API. For more information on case escalation, see the Salesforce online help. Label is Escalated.
IsSelfServiceClosed boolean Defaulted on create

Filter

Indicates whether the case is closed for Self-Service users (true) or not (false).
IsVisibleInSelfService boolean Defaulted on create

Filter

Indicates whether the case can be viewed in the Customer Self-Service Portal (true) or not (false).
Origin picklist Create

Filter

Nillable

Update

The source of the case, such as “Email,” “Phone,” or “Web.” Label is Case Origin.
OwnerId reference Create

Defaulted on create

Filter

Update

ID of the contact who owns the case.
ParentId reference Create

Filter

Nillable

Update

The ID of the parent case in the hierarchy. The label is Parent Case.
Priority picklist Create

Filter

Nillable

Update

The importance or urgency of the case, such as “High,” “Medium,” or “Low.”
Reason picklist Create

Filter

Nillable

Update

The reason why the case was created, such as “Instructions not clear,” or “User didn’t attend training.”
Status picklist Create

Defaulted on create

Filter

Nillable

Update

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.
Subject string Create

Filter

Nillable

Update

The subject of the case. Limit: 255 characters.
SuppliedCompany string Create

Filter

Nillable

Update

The company name that was entered when the case was created. Cannot be updated after the case has been created. Label is Company.
SuppliedEmail email

Create

Filter

Nillable

Update

Create

Filter

Nillable

Update

The email address that was entered when the case was created. Cannot 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. For more information, see "Setting Up Auto-Response Rules" in the Salesforce online help.

SuppliedName string Create

Filter

Nillable

Update

The name that was entered when the case was created. Cannot be updated after the case has been created. Label is Name.
SuppliedPhone string Create

Filter

Nillable

Update

The phone number that was entered when the case was created. Cannot be updated after the case has been created. Label is Phone.
Type picklist Create

Filter

Nillable

Update

The type of case, such as “Feature Request” or “Question.”
Note
If you are importing Case data into Salesforce and need to set the value for an audit field, such as CreatedDate, contact salesforce.com. Audit fields are automatically updated during API operations unless you request to set these fields yourself. For more information, see System Fields.

Usage

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

Assignment Rules

When you create() or update() a case, your client application can have the case automatically assigned to one or more Users based on assignment rules that have been configured in the Salesforce 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() call:

Field Field Type Description
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.

See Also:
Account
© Copyright 2000-2008 salesforce.com, inc. All rights reserved.
Various trademarks held by their respective owners.