Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

getCaseIdFromEmailThreadId(emailThreadId)

Returns the case ID corresponding to the specified email thread ID. (Deprecated. Use getCaseIdFromEmailHeaders and EmailMessages.getRecordIdFromEmail instead.)

Signature

public static ID getCaseIdFromEmailThreadId(String emailThreadId)

Parameters

Return Value

Type: ID

Usage

The argument for emailThreadId, also known as Ref ID, has the format !00Dxx01gEW.!500xx0Yktl. This format was introduced in the Winter ‘24 release. The previous format, _00Dxx1gEW._500xxYktl, is supported for backward compatibility, but emails sent from the Winter ‘24 release onward use the new format. Other formats that include ref: or [ref: aren’t supported by this method.