Loading
Salesforce Enforces New Security Requirements in Summer 2026Read More
FieldCondition Class

FieldCondition Class

Builds a SOQL condition for a field based on the specified operator. Extends OperatorCondition.

Required Editions

Available in: Lightning Experience
Available in: Enterprise and Unlimited Editions with Life Sciences Cloud, Life Sciences Cloud for Customer Engagement Add-on license, and the Life Sciences Customer Engagement managed package.

constructor(field, operator, value)

Creates an instance of FieldCondition.

This method accepts these parameters.

Parameter Type Description
field String The name of the field to use as part of a condition.
operator String The operator to use as part of a condition.
value String The value to use as part of a condition. A null value is supported for the = and != operators.

toSoql()

Returns the generated SOQL query as a string.

Example

await new ConditionBuilder(
   "Inquiry",
   new FieldCondition("Type", "=", "MedicalInquiry")
).build()
 
// Returns: "Type = 'MedicalInquiry'" 
 
Loading
Salesforce Help | Article