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
orph351orph351 

Is it possible to move an opportunity from one campaign to another using workflow?

We're trying to figure out if it is possible to move an opportunity from one campaign to another. 

Is this possible with workflow or do we need to use a trigger?
Best Answer chosen by orph351
BalajiRanganathanBalajiRanganathan
it is not possible update lookup field using workflow rule. you have to do this in a Trigger code. it will be coming in the next release as per the link below

https://success.salesforce.com/ideaView?id=08730000000BrGdAAK

All Answers

PratikPratik (Salesforce Developers) 
Hi,

Will you please elaborate  that you want to change the "Primary Campaign Source" on the Opportunity? Aslo is it one time exercise or ongoing? Please elaborate on the requirement so we can help you.

Thanks,
Pratik
BalajiRanganathanBalajiRanganathan
it is not possible update lookup field using workflow rule. you have to do this in a Trigger code. it will be coming in the next release as per the link below

https://success.salesforce.com/ideaView?id=08730000000BrGdAAK
This was selected as the best answer
orph351orph351
Thanks for your responses.

The primary campaign source on the opportunity is initially marked with a campaign (voting docket) that serves as a holding place until the opportunity is voted on.

The votes are submitted using a visualForce page and stored in a custom object called voteResponse. When each opportunity has four votes, I need to set the campaign to the next available campaign (campaigns are created twice each month by date like the 15th and 30th).

Should I create the trigger on the voteResponse object and then set the primary campaign source to the next available campaign? I guess the trigger should run after insert to trusteeResponse and then check to see if the vote count is = four, then set the primary campaign source to next available campaign.

Does that sound right? Not sure how to grab the next available campaign.