-
Notifications
You must be signed in to change notification settings - Fork 4
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
copy currency code to new account #4141
copy currency code to new account #4141
Conversation
**lurch: add W-031981 |
Tracking W-032112 |
@mattparlane, Thank you for your contribution. We have incorporated your suggestion with changes for orgs without multi-currency enabled. Please let us know if there are any questions. |
Vunderbar! Any idea what version it will be included in? I'd like to let my people know when it's released. |
@sam-knox can you review the changes section to make sure the wording is correct . Thanks |
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.
I've updated the Changes for this PR.
@mattparlane - It is scheduled to be in the next release |
**lurch: attach W-031981 |
Tracking W-031981 |
String defaultCurrency = UserInfo.getDefaultCurrency(); | ||
|
||
Contact newContact = new Contact( | ||
lastname = 'CurrencyTest', |
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.
Let's use CamelCase for fields API names, ie LastName
and FirstName
.
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.
@RadSFDeveloper Thanks. I've updated the names
…ub.com:SalesforceFoundation/Cumulus into feature/pyan/populate-currency-field-on-create
@@ -560,6 +560,11 @@ public class ACCT_IndividualAccounts_TDTM extends TDTM_Runnable { | |||
a.Phone = c.Phone; | |||
a.Fax = c.Fax; | |||
a.OwnerId = c.OwnerId; | |||
|
|||
if (UserInfo.isMultiCurrencyOrganization()) { | |||
a.put('CurrencyIsoCode', String.valueOf(c.get('CurrencyIsoCode'))); |
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.
Let's cast into String, ie a.put('CurrencyIsoCode', (String) c.get('CurrencyIsoCode'));
* @description Accounts created from the trigger should populate the currency code with the contact | ||
*/ | ||
@IsTest | ||
private static void accountCreatedWithCorrectCurrencyCodes() { |
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.
shouldPopulateNewAccountCurrencyWithContactCurrency()
?
|
||
String qryString = 'SELECT Id, Name' + currencyField + ' FROM Account LIMIT 1'; | ||
Account newAccount = Database.query(qryString); | ||
System.assertNotEquals(null, newAccount, 'New Account was not created'); |
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.
Let's specify expected state in the assert statements. For example: New Account should be created
or Account Currency should be populated
.
if (isMultiCurrencyEnabled) { | ||
|
||
// Set currency to be something different than the default one if possible | ||
List<SObject> currencies = Database.query('SELECT IsoCode FROM CurrencyType WHERE IsActive = True'); |
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.
How about using UTIL_UnitTestData_TEST.nonDefaultCurrencyType
for this test? See similar tests in PMT_Payment_TEST
.
…ub.com:SalesforceFoundation/Cumulus into feature/pyan/populate-currency-field-on-create
@RadSFDeveloper - I've made the requested changes. Thanks |
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.
Looks good!
@rponti-sforg This is ready for QA. Thanks |
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.
QE testing has been completed for this PR. Tests have passed.
For further testing details, see: https://foundation.lightning.force.com/lightning/r/agf__ADM_Work__c/a2x1E000008LlirQAC/view
Merging PR and deleting branch.
Critical Changes
Changes
Issues Closed
New Metadata
Deleted Metadata