Problem/Motivation
The 7.x-3.x version had an option on the mapping interface to select which Record Types to request on pull, making it easy to see what the mapping was targeting, and easy to configure. 8.x+ replaced this with a more flexible but less user-friendly 'Pull query SOQL "WHERE" clause' field, which is very handy, but less user-friendly. There's no reason not to allow both to be used, as you can add multiple "where" clauses to an API call, making the existence of both pretty clean in the code.
Added motivation for this: we are using the module in a distribution, which uses a Salesforce package. The SF package does not stabilize record type IDs, so we have to customize this setting for every site. Much easier with a quick point-and-click than digging out record IDs each time.
Proposed resolution
Add another config field on mappings for this.
Remaining tasks
Probably needs a test.
User interface changes
Just another field on the mapping UI.
API changes
None.
Data model changes
Just another field on the mapping config.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | salesforce-n3213468-14.patch | 5.14 KB | wxactly |
| #2 | record_type_filter-3213468-2.patch | 5.42 KB | gcb |
Issue fork salesforce-3213468
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
gcbComment #3
aaronbaumanI would rather avoid relying on the RecordType.Id, which changes between environments.
This will be troublesome to manage, when otherwise mappings to not need to change between environments.
Comment #4
gcbGood point. It didn't occur to me that there was another option! Do you know if we're able to use RecordType.label in SOQL queries? I can dig into the api and/or experiment of course.
Comment #5
aaronbaumanRecordType.DeveloperName is the preferred source
Comment #7
gcbThanks! That is... much better.
Re-rolled to use developer name as an issue fork as I saw you appreciating those in some other ticket ;)
Comment #8
gcbComment #9
gcbOops, my initial attempt to convert to an issue branch went poorly. I undid my direct commits to the 8.x-4.x branch and did it properly.
Comment #10
gcbNot sure how to do a separate issue branch for 5.x, so... here's a patch that applies to 5.x!
Comment #11
damienmckennaComment #12
damienmckennaRerolled.
Comment #13
dishvola commentedHey DamienMcKennam, why you are removed 'Pull query SOQL "Where" clause' option?
Comment #14
wxactly commentedIt looks like the extra pull_where_clause code was removed in https://git.drupalcode.org/project/salesforce/-/commit/d041e14e5e00c020e... so the patch in #12 was accidentally removing it again. Here's another reroll that leaves pull_where_clause alone
Comment #15
wxactly commentedComment #16
wxactly commentedComment #17
damienmckennaThanks for fixing the patch, wxactly.
Comment #19
aaronbaumanCommitted, thanks for everyone's work on this