Loading

Change Case 'Account Name' when related Contact is changed

Publiceringsdatum: Jun 10, 2026
Beskrivning

In Salesforce Lightning Experience, when a Case is related to a Contact, via the standard 'Contact Name' field, the 'Account Name' is automatically populated when it has no value. However, when a User has Edit access to the 'Case: Account Name' field, any subsequent changes to the related Contact will not automatically change the related Account. The related Account must be changed manually.

Note: The Flow-based workaround described below is intended for use in Lightning Experience only. Users with read-only access to the Account field will find that the Account field is automatically updated when the Case Contact field is updated in Salesforce Classic.

Lösning

To automatically update the Account Name on a Case when the related Contact changes, create a Salesforce Flow on the Case object as described below. This Flow triggers whenever a Case is created or edited and the Contact ID has changed, then updates the Account Name field to match the Contact's associated Account.

Create a Flow to Update Account Name on Case

  1. Navigate to Setup. Type "Flow" in the Quick Find box. Click New.
  2. Create the Flow on the Case object.
  3. Set the Flow to start: When a record is created and edited.
  4. Set Criteria for Executing Actions: Conditions are met.

       

Flow Criteria Settings

       Set the following two conditions (both must be true — AND logic):

  • Condition 1: Field = Case Contact ID | Operator = Is Null | Type = Boolean | Value = False
  • Condition 2: Field = Case Contact ID | Operator = Is Changed | Type = Boolean | Value = True

       5.Set Conditions: All the Conditions are met (AND).

       6.Select Immediate Actions.

       7.Action Type: Update Records.

       8.Record Type: Select the Case record that started your process.

       9.Criteria for updating records: No Criteria — Just update the records.

     

Field Update Settings

      Set the field to update on the Case record:

  • Field = Account ID | Type = Reference | Value = [Case].Contact.AccountId.

      This tells the Flow to look up the Account associated with the newly selected Contact and set it as the Case            Account.

      10. Activate the Flow.

Ytterligare resurser

See also:
Create a Process

Knowledge-artikelnummer

000387888

 
Laddar
Salesforce Help | Article