You need to sign in to do that
Don't have an account?
ApolloS
Help with trigger. Copy Primary Campaign Source from 1st Opp. to newer w/ same Account?
We have a business rule, that if 1st Opportunity created under the Account has a Primary Campaign Source set to a certain Campaign, then every opportunity after has to have save Primary Campaign Source.
Issue is, sales people forget to enter that, or don't bother looking it up, if they are in a rush.
So I need a trigger, that looks up 1st Opportunity under the Account (which is set to Type = New Business) and copies the Primary Campaign Source from that Opportunity, to any subsequent Opportunities under the same Account.
How do I go about doing that?
Sounds like a very good use case for Apex to solve.
Here is how I would solve it.
Please keep in mind I did not test this code or write it in a IDE. You will need to make it production ready by adding checks and testing it in sandbox.
It's meant as a starting point and not an implementation of your use case.