fflib-apex-common icon indicating copy to clipboard operation
fflib-apex-common copied to clipboard

Add support for upsert by external Id

Open jonathanwiesel opened this issue 4 years ago β€’ 12 comments

I'm afraid that since there's no external id field in the standard data model I found no way to create a test for this.

Closes #269


This change is Reviewable

jonathanwiesel avatar Apr 07 '20 13:04 jonathanwiesel

@jonathanwiesel in your test you can register an IDML mock impl and assert on the parameters passed to its methods. I have seen this done in another PR recently.

afawcett avatar Apr 07 '20 19:04 afawcett

@afawcett thank you! Will take a look to locate it and see how it goes

jonathanwiesel avatar Apr 07 '20 20:04 jonathanwiesel

@afawcett Instead of using the isExternalId from the DescribeFieldResult class, I changed to use the isIdLookup which is specifically for upsert operations to be more consistent and also supports the standard Id, which allowed me to create a test for it.

jonathanwiesel avatar Apr 08 '20 09:04 jonathanwiesel

Any feedbackcon this? Is been quite a while πŸ’”

jonathanwiesel avatar Jun 09 '21 22:06 jonathanwiesel

Any feedbackcon this? Is been quite a while πŸ’”

Apologies, this fell off my radar. Let me take a deep review and give this some testing. Thank you very much for the work on this. :)

ClayChipps avatar Jun 16 '21 03:06 ClayChipps