You need to sign in to do that
Don't have an account?
lopezc
create CampaignMember from Sites
I have created a site with a very simple form. It only should creates CampaignMembers but it is failing:
Insert failed. First exception on row 0; first
error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights
on cross-reference id: []
The Site user has profile "Guest User License". I gave him permissions to read and create campaigns but I don't know how to give him permissions to create Campaign members. Any idea?
Thanks!!
Another option if you're always looking to create leads as well is to use web to lead & pass the campaignID
http://blogs.salesforce.com/marketing/2007/03/autoassociating.html
DVP is right - to create new campaign members, the following is needed:
- Edit on Lead or Contact
- Read on Campaigns
- Sharing privledges to view that Lead or ContactGuest User is like another user - if they can't see the lead or contact due to private sharing, then they can't create a CM for it. You'd have to have a sharing rule to open it up if your model is private.
I gave permissions to read/edit on Lead and Contacts, I also gave permissions to the user to read on Campaigns and every single custom object and I still don't know why it is not working.
There is also another problem. Before creating the CampaignMember the code looks for a matching contact based on the email. For this specific example, the contact exists so it should find it and create the campaign member attached to it (I am not always looking and creating leads, only if the contact doesn't exist, so I don't want to use WebToLeads). The problem is that it doesn't find it! The query returns an empty list so a lead is finally created.
To see where the problem was I have created a test method that does exactly the same thing (submit a form) and runAs the "Site user" and the weird thing is that it worked!! So it must be something different with the Site, but the user as permissions to see the contact and create the campaignMember in the test method:
static testMethod void myUnitTest() {
List<User> user = [Select Id from User where ProfileId = '00eR0000000IEzw'];
System.assertEquals(user.size(), 1);
System.runAs(user.get(0)){//Member4 is an existing contact in the data Base
WebinarProcessor.updateCampaignWithWebinar('Member4', 'Member4', 'member4@member4.com', 'sv_SE', 'igi', '701R00000002F3o');
}
}
Follow this click path:
Setup-->Administration Setup-->Security Controls-->Sharing Settings-->Edit
If any of Lead, Contact, or Campaign are private, then that means only the owner of the record can view those leads, contacts or campaigns, and has implications for campaign member as well.
If they are Public, then sharing isn't the problem here.
If they are private, you'll need to set up sharing rules, which are rules that say who can see what, and specifically give the Guest User access to the leads & contacts that are campaign members (or all leads & contacts if that's easier).
yes, I found it, they both appear to be private, thanks!
Now, i want to give permissions to only my "Site User". I have set up a public group with my user but in the page when setting up a sharing rule it ask me for which leads I want to share with that group ("Leads owned by memebers"). I just want to give it permissions to All leads in my organisation. how do I do that?Do I have to create a public group with all my users? is there not something by default like 'sharing All' ?
thanks
Oh actually no worries, I found the answer myself: Roles and Internal Subordinates (System Administrator)
Thanks for the help!!
We are running into the same problem - can't make an attached Campaign Member record - even though we have a Sharing Rule set for that User. It seems that the Lead.ConvertedContactID field is not available via the Sites form when inserting a new Lead which is converted to a Contact upon insert by code we have in place. And this is the case even when running in System mode.
Please help.
Thanks,
David.
The Guest User has sharing access to both the converted lead and the new contact?
Does the guest user have Edit on both lead & contact as well?