function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

how to write a trigger on Account object if the record is exist then update if not exist then create new record ?

Hi Every one ,
How to write a trigger on Account Object if the record is Exist then update the records else created new Account Records ?

v varaprasadv varaprasad
Hi Aki,

As per my knowledge, we cannot achieve this functionality through the trigger. We need to use visual force pages or lightning pages for this.

Hope this helps you!
If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others.

Salesforce Freelance Consultant/Developer/Administrator
@For Salesforce Project Support:

Salesforce latest interview questions  :

hi V Varaprasad 

how to solve this problem with Visualfroce Page or Lightning page pealse example ? 

becasue my mind saying that its achived by Trigger. if duplicate record found then update some fields and if not found duplicate then create new Account 

Nandigam RajeshNandigam Rajesh
Hi Aki,
Hope you are doing good. You mean upsert operation?/