Loading

InsPolicyService:cancelPolicy Throws "Field Is Not Editable" Error When the Ins_GetPolicyDetails Field Set Contains Formula Fields

Veröffentlichungsdatum: Jun 15, 2026
Beschreibung

When calling InsPolicyService:cancelPolicy , the service returns:

{
  "errorCode": "INVOKE-500",
  "error": "Field <custom field> is not editable"
}

The cancelPolicy service internally:
1. Queries the InsurancePolicy record using the fields defined in the Ins_GetPolicyDetails Field Set
2. Modifies the Status and related lifecycle fields
3. Performs an UPDATE DML on the record including all queried fields

If any field in Ins_GetPolicyDetails is a formula field, Step 3 fails because Salesforce does not allow formula fields in UPDATE operations.

Lösung

Remove all formula fields from the Ins_GetPolicyDetails Field Set:

1. Navigate to Setup → Object Manager → InsurancePolicy → Field Sets
2. Open Ins_GetPolicyDetails
3. Identify any formula fields in the "In the Field Set" section
4. Drag the formula field(s) back to the "Available for the Field Set" section (or remove entirely)
5. Click Save

**Note: Removing a field from the Field Set does not delete the field. It only excludes it from being queried and updated by the managed service. The formula field remains available for page layouts, reports, and other purposes.

Nummer des Knowledge-Artikels

005387143

 
Laden
Salesforce Help | Article