Sounds to me like you need to have the trigger fire after insert on CampaignMember. Make sure you include an IF statement that checks to see that the Contact ID != null on the CampaignMember record.
Also, make sure you query the Campaign and populate the Campaign field on the opportunity to ensure it gets associated to the campaign as well.
You could create an opportunity from a contact and an after insert trigger. You'd need to provide some fields that may not be obvious - close date, for example.
another question - what I am being asked to do is when a contact is added to a campaign (becomes campaign member) of a certain record type - create a new opportunity related to that contact - I am being told that the contact will already exist. Tyring to wrap my head around this one - campain memeber ship is a related list on contact, but that is all. Not sure if I need to add a field on contact to reflect campaign membership specifically for that record type in order to give something to trigger off of.
Sounds to me like you need to have the trigger fire after insert on CampaignMember. Make sure you include an IF statement that checks to see that the Contact ID != null on the CampaignMember record.
Also, make sure you query the Campaign and populate the Campaign field on the opportunity to ensure it gets associated to the campaign as well.
Sounds to me like you need to have the trigger fire after insert on CampaignMember. Make sure you include an IF statement that checks to see that the Contact ID != null on the CampaignMember record.
Also, make sure you query the Campaign and populate the Campaign field on the opportunity to ensure it gets associated to the campaign as well.
All Answers
You could create an opportunity from a contact and an after insert trigger. You'd need to provide some fields that may not be obvious - close date, for example.
Thanks Bob,
another question - what I am being asked to do is when a contact is added to a campaign (becomes campaign member) of a certain record type - create a new opportunity related to that contact - I am being told that the contact will already exist. Tyring to wrap my head around this one - campain memeber ship is a related list on contact, but that is all. Not sure if I need to add a field on contact to reflect campaign membership specifically for that record type in order to give something to trigger off of.
Trigger on the Campaign using the contact's id in the record to create the opportunity
Sounds to me like you need to have the trigger fire after insert on CampaignMember. Make sure you include an IF statement that checks to see that the Contact ID != null on the CampaignMember record.
Also, make sure you query the Campaign and populate the Campaign field on the opportunity to ensure it gets associated to the campaign as well.
That worked - thanks!
Glad it worked for you!