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
Suresh RaghuramSuresh Raghuram 

closed date on opportunity when stage set to closed

Hi community ,


Let me give backround about my requirement.

I need to populate a Look up field with the campaign Name (The campaign name  is already existing on opportunity this will keep changing when a new campaign member added to the contact(In retrun this contact will be related to the opportunity)) when the stage on opportunity set to closed won or Closed lost the specific name in the Campaign Name should be populated in the Lookup field . For the new records it works fine by batch process . but for populating the existing records i need a process.


Do any body have ideas or come across this .


Thanks in advance for your time and help. 


Imran MohammedImran Mohammed

I am not sure if you have taken the Trigger approach, if not you can have after/before update trigger(with/without batch process) and add the logic to achieve the requirement you have.

Suresh RaghuramSuresh Raghuram

Thanks for the reply ,


Actually we have  3 text fields on opportunity, we replaced them through lookup fields, now we want to do datacleansing and get the legasy data also. here our real problem starts.

It is when stage is set to closed  the value in the 2nd field will be populated in the 3rd one . 2 nd will keep updating based on the related fields . but 3rd will remain unchange until the stage changes.


since 2nd one is keep on changing we can not rely on that for legacy data. But from the opportunity history we can find when the stage is set to closed, I found this after my research. My idea is after getting that date of stage change to closed and compare with when 2nd value history what value was it holding during that period of time.


It sounds wague but i had task to  accomplish.

I will appriciate if you share your ideas, Thanks in advance.