1

I am trying to find an automated way to add contacts & leads to existing campaigns by using simple salesforce to upsert records to the CampaignMembers object. I have a CSV file with CampaignId and ContactId. However, I am getting an error that says `"salesforce_bulk.sal

2
  • Did you check Field Level Security?
    – Adrian Larson
    Jun 8, 2021 at 21:43
  • Yes. @AdrianLarson
    – codr
    Jun 8, 2021 at 21:47

1 Answer 1

3

Make sure that you are Marketing User.

You can find Marketing User checkbox on the User record that you are using to load data. Campaign objects security depends on this permission.

When enabled and the user has Read permission on contacts or the Import permission on Leads, and Edit permission on campaigns, the user can create, edit, and delete campaigns, configure advanced campaign setup, and add campaign members and update their statuses with the Data Import Wizard.

Update

Double verify all the permissions listed here are taken care of.

After an examination, the problem seems to be in the library salesforce-bulk. The library has not been updated in a while and seems like it causes this issue due to invalid headers sent as discussed here.

You can avoid it and use simple-salesforce

12
  • I have system admin access and here are my field-security settings for Campaign Member object (see new image above). It seems correct to me. @MohithShrivastava
    – codr
    Jun 9, 2021 at 13:20
  • 2
    FLS is not the same thing as Marketing User. You need to check that setting on your User record.
    – David Reed
    Jun 9, 2021 at 13:24
  • Marketing User was already enabled for my User record. @DavidReed
    – codr
    Jun 9, 2021 at 13:53
  • 2
    @ParthPatel Can you add the campaign member records manually via the UI? Also make sure you are using your org username for running the job! I was able to replicate and moment I use marketing user checkbox the issue was fixed! So double check Jun 9, 2021 at 13:57
  • 1
    I am using simple salesforce. I posted my code above @MohithShrivastava
    – codr
    Jun 9, 2021 at 14:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .