-
Notifications
You must be signed in to change notification settings - Fork 528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow setFieldValueByMap to consume a Map<Id, Id> #390
base: master
Are you sure you want to change the base?
Conversation
@JAertgeerts -- thanks for the PR. A couple of questions:
|
@ImJohnMDaniel The purpose of the domain is to allow easy access to the list of objects it contains. There are three primary types of methods on the domain; getters, setters and filter methods. This method allows for easy setting and Id field based on the provided map. An example would be the following method, which sets the Case.OwnerId based on the provided map. It check if the Case.AccountId is populated in the map, if so, then it takes the value of that key and sets it to the provided target field, the Case.OwernId.
Since Salesforce is a bit limited with casting a Map<Object, Object> to a Map<Id, Id> we need another method overload. |
@JAertgeerts, just following up on the request to provide matching code coverage for this method. Cheers! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @ImJohnMDaniel, @JAertgeerts, and @stohn777)
sfdx-source/apex-common/main/classes/fflib_SObjects.cls, line 294 at r1 (raw file):
* @param values Map of values to store by the sObjectFieldToCheck fields value */ protected virtual void setFieldValueByMap(
Agreed with JohnD, we need a test method to cover this new code path
Now it can consume a Map<Id, *> and Map<String, *> and includes unit-test Replaces PR: apex-enterprise-patterns#390
Now it can consume a Map<Id, *> and Map<String, *> and includes unit-test Replaces PR: apex-enterprise-patterns#390
This change is