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
immaimma 

update a custom field that calculates the number of leads

Hello everyone 
I have a custom field named "number of leads" associate to a campaign object and I want to calculate a number of leads associate to this company 
when a lead was registred , the value of  "number of leads " became number of leads +1
what can I do ?? 
thank you for your time
Hargobind_SinghHargobind_Singh
Hi, if you want to update the values of field when Lead is created (am assuming you mean "Created" by "Registered"),you would need to write a trigger on lead object to update the value.

 
immaimma
ok thank you very much , I will try because I don't have any experience with apex and trigger