Finding a Case Object by its Case Identifier

From within a script, use the findByCaseIdentifier method on the appropriate case access class to return the case reference to the case object that matches the specified case identifier value(s).

Method syntax Description
findByCaseIdentifierName(caseId) Returns the case reference to the case object that matches the specified caseId case identifier value.

One findBymethod is available for each CaseIdentifierName attribute of type Auto or Custom defined on the case class.

findByCompositeIdentifier(caseId,caseId,..) Returns the case reference to the case object that matches the specified composite case identifier values.

A single findByCompositeIdentifier method is available if the case class has a composite case identifier. The method contains one caseId parameter, of the appropriate type, for each attribute that is part of the composite case identifier.

The method returns null if there is no case object that matches the specified caseId value(s).

Example

This example finds a customer's ID using the value in a custID field, which is assumed to have been populated earlier in the process (for example, by a customer service representative filling in a form when the customer telephones).

	// Get the case reference to the Customer class that matches the identifier provided in the custID field.
	customerReference = cac_com_example_ordermodel_Customer.findByAutoCaseIdentifier1(custID);

	// You can now read the reference to get the corresponding Customer case data object.
	customer = customerReference.readCustomer();