apex-enterprise-patterns / fflib-apex-common

Common Apex Library supporting Apex Enterprise Patterns and much more!
BSD 3-Clause "New" or "Revised" License
899 stars 514 forks source link

Unit test failure in multi-currency org #437

Closed stohn777 closed 6 months ago

stohn777 commented 1 year ago

Describe the bug

When deployed into an org having multi-currency enabled, the fflib_SObjectSelectorTest.testPolymorphicSelectWithRelatedType test fails with the exception "fflib_QueryFactory.InvalidFieldException: Invalid field 'CurrencyIsoCode' for object 'Group'".

To Reproduce

  1. Create a scratch org from the project's only definition file.
  2. In the org's Company Information, enable multi-currency.
  3. Push the source to the org.
  4. Run all tests.
  5. Note that all tests pass except for fflib_SObjectSelectorTest.testPolymorphicSelectWithRelatedType with the following exception.
fflib_QueryFactory.InvalidFieldException: Invalid field 'CurrencyIsoCode' for object 'Group'
Class.fflib_QueryFactory.getFieldPath: line 131, column 1
Class.fflib_QueryFactory.selectField: line 224, column 1
Class.fflib_SObjectSelector.configureQueryFactoryFields: line 388, column 1
Class.fflib_SObjectSelectorTest.testPolymorphicSelectWithRelatedType: line 486, column 1

Expected behavior In a multi-currency org (as well as a single-currency org), all tests should pass.

Version Latest version of master as of 2022-12-22 (commit: fbe6df4ac670c914a6d43481bdb465276acfabdf).

szymon-halik commented 1 year ago

I just encountered the same error once running the tests. Do we have any ETA when this will be fixed?

stohn777 commented 1 year ago

Hi @szymon-halik. Thanks for letting us know that you've experienced this issue too. A PR is waiting for approval from the other maintainers. https://github.com/apex-enterprise-patterns/fflib-apex-common/pull/438

szymon-halik commented 1 year ago

@stohn777 keeping fingers crossed for a quick code review :wink:

daveespo commented 6 months ago

Resolved in July 2023 via #438