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
Ashish_Sharma_DEVSFDCAshish_Sharma_DEVSFDC
Hi Imma,

As there is no master detail relationship so Roll up summary field can not be used.

It can be achieved through a small triger code on Campaign Member object.

Let us know if it helps you.
immaimma
Thank you Ashish but i don't have any experience with code !! could you help me more please ??
 
HaiderRaza77HaiderRaza77
Campaign has already got the Total Leads and Total Contacts fields, you just need to appear them on the page layout.

What I understand you need +1 for that create a custom formula field and add 1 to the total leads field.
campaign
immaimma
 I want a field like that but with an other personnel object , so how they do this field : " total leads " ?? with workflow or a trigger ?? 
HaiderRaza77HaiderRaza77
Create a master detail relationship and use rollup summary field.
Domnic JohnsonDomnic Johnson
If you have individual campaigns for each company, then you could create a formula field on the personel object and mirror the number of leads from campaign object itself