Trigger on contact to update a account custom field.

Vijay Kumar
2 min readAug 7, 2020

Hey guys, today in this post we are going to learn about How to update the FirstName & LastName to the account on custom field contactSummary (Long Text Area) using trigger in Salesforce.

Account Custom Fields & Relationships

Create a custom field on Account name as contactSummary__c (Long Text Area).

Real time scenarios:- Write a trigger on contact and update the FirstName & LastName to the account on custom field contactSummary (Long Text Area) whenever contact record is only updated.

Trigger fired whenever contact record is only updated.

Standard object:- Account >> New custom field:- contactSummary__c (Long Text Area)

Standard object:- Contact >> Standard fields:- FirstName, LastName

Files we used in this post example:-

contactTriggerRollSummary.apxt

Apex Class Trigger

It will be fired whenever contact record is updated

Parent Object:- Account

Custom Field :- contactSummary__c

Parent Object with Custom Field

Trigger on contact and update the FirstName and Lastname to the account on custom field contactSummary (Long Text Area).

Child Object:- Contact

Standard Field:- FirstName, LastName

Child Object with Field

Contact FirstName and LastName will be updated to account whenever record is edit and save.

You can download file directly from github by click here Final Output

Other post that would you like to learn

Step 1:- Apex Class Trigger : contactTriggerRollSummary.apxt

From Developer Console >> File >> New >> Apex Trigger

contactTriggerRollSummary.apxt [Apex Class Trigger]

Other related post that would you like to learn

Originally published at https://www.w3web.net on August 7, 2020.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet

Write a response