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

Insufficient Privileges CampaignMember



I have a simple visualforce page accessed via sites that inserts a lead, and then inserts campaignmember. It works in SF when I'm logged in, but the second insert generates an "insufficient priviledges" error when using sites. We have given the sites profile access as follows and the apex below is below that. Any help would be appreciated. Many thanks



AccountsRead, Create96Tab HiddenCQS Account Layout
Accounts Data QualityNo Access9--Account Data Quality Layout
Activities----Tab Hidden--
Ad GroupsNo Access8--Ad Group Layout
Answers----Default On--
Articles----Tab Hidden--
Asset RegistersNo Access5Tab HiddenAsset Register Layout
AssetsNo Access34--Licence Layout AS
Business UnitsNo Access5Tab HiddenBusiness Unit Layout
Campaign Calendar----Tab Hidden--
Campaign ColorsRead, Create, Edit12--Campaign Color Layout
Campaign Members--31--Campaign Member Page Layout



Database.DMLOptions dmo = new Database.DMLOptions();
				dmo.assignmentRuleHeader.useDefaultRule = true;
				insert lead;

				CampaignMember mem = new CampaignMember (campaignid=ApexPages.currentPage().getParameters().get('campaignid'),;
				insert mem;