Describe the bug
Hi, I was trying to setup a Leads push and I noticed that when using a Salesforce user who can create Leads but cannot edit them, the plugin doesn't push the new Wordpress record to Salesforce. Adding Edit permission to the user solves this, but it prevents to use a least privileges possible policy and results in a confusing UX.
To Reproduce
Steps to reproduce the behavior:
- Create a Fieldmap to push some Wordpress object as Salesforce Leads using a Salesforce user who can create but not edit Leads. Probably Salesforce fields will be displayed as Locked.
- Create the Wordpress record
- Push won't be performed and a debug log will be created if this is setup
Expected behavior
If the Salesforce user can create records, new Wordpress records should be pushed to Salesforce.
Screenshots
Screenshot of ignored push log:

Environment (please complete the following information):
- WordPress Version: 6.4.5
- PHP Version 7.4.33
Additional context
I think this is due to considering as locked / read-only fields those who are not updateable, even when they are createable.
See this in Fiedmap page and the next one used in push class:
|
if ( false === $salesforce_field['updateable'] ) { |
|
if ( 1 !== (int) $fieldmap['salesforce_field']['updateable'] ) { |
Describe the bug
Hi, I was trying to setup a Leads push and I noticed that when using a Salesforce user who can create Leads but cannot edit them, the plugin doesn't push the new Wordpress record to Salesforce. Adding Edit permission to the user solves this, but it prevents to use a least privileges possible policy and results in a confusing UX.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
If the Salesforce user can create records, new Wordpress records should be pushed to Salesforce.
Screenshots
Screenshot of ignored push log:
Environment (please complete the following information):
Additional context
I think this is due to considering as locked / read-only fields those who are not updateable, even when they are createable.
See this in Fiedmap page and the next one used in push class:
object-sync-for-salesforce/templates/admin/fieldmaps-add-edit-clone.php
Line 310 in 9e4535e
object-sync-for-salesforce/classes/class-object-sync-sf-mapping.php
Line 1096 in 9e4535e