mattaddy / SObjectFabricator

An SObject fabrication API to reduce database interactions and dependencies on triggers in Apex unit tests.
Other
89 stars 14 forks source link

Adding overloaded methods to handle Parent object reference using token and syncing the id on the child #9

Open jefersonchaves opened 6 years ago

jefersonchaves commented 6 years ago

Added possibility to set Parent using Field Token. Added possibility to set Parent object along to Id on the child. Added capability to retrieve field values.

jefersonchaves commented 3 years ago

Hi, @bobalicious : is this something worth adding? I can tidy it up if is something worth it.

bobalicious commented 3 years ago

It's along the lines of the kind of thing I was going to think about next, but it depends on how complete the solution should be - bear in mind the different ways that a parent relationship can now be set, using String names to automatically generate intermediate steps (e.g. Setting Account.Contact.Owner on an Opportunity). I haven't thought about it in-depth.

I guess a key question is - have you found it useful. If so, then it's probably worth exploring again. If not, then maybe not.

If the PR is re-raised, I'd welcome it, and I'll be happy to review and potentially merge - as long as it fits into the current API nicely.

jefersonchaves commented 3 years ago

I actually have found this useful on one project, but to be honest it has been a long while.

I can take a look at updating this with the latest API, potentially submitting a new PR.