LightningFlowComponents icon indicating copy to clipboard operation
LightningFlowComponents copied to clipboard

*Datatable 3.3.2* - Multi-currency edit leads to wrong/confusing value

Open jncart opened this issue 3 years ago • 2 comments

Steps to reproduce

In an org with multi-currency enabled and at least two currencies configured.

Steps to reproduce the behavior:

  1. Create a record with a currency field and set the ISOCode value to something other than the running User's locale currency setting
  2. Create a screenflow with a datatable component and configure to display the record with the currency field as editable
  3. Edit the currency field and save

Expected behaviour

If the currency is displayed in the user's locale currency then edited values should be entered in the user's locale currency value, converted to the edited record's currency value, and then saved.

Actual behaviour

The edited value is saved in the record's currency value. For example, a record has a currency field with $500 and ISOCode XXX for a user with USD as locale currency, which is worth 2.0 times XXX. Datatable displays the value as $1000. User edits the currency value to $1500 in datatable. After save, the value on the record is now $1500 XXX and displays in the datatable as $3000.

jncart avatar Oct 20 '21 18:10 jncart

For now, I will look into adding an attribute to disable the conversion of currency fields. If not selected, I will disable the ability to edit currency fields.

ericrsmith35 avatar Oct 20 '21 19:10 ericrsmith35

Just want to add some comments here as well.

  1. we are also affected by this issue, multi currency org.

  2. i did create a workaround of sorts by looping through an "edited records collection" and doing the currency conversion in flow prior to the update action. image

  3. this workaround created an unintentional issue in the flow where if the user edits any column other than the currency field to be converted, it would take the currency field and "re-convert it". doesnt seem to be a way to do a priorvalue or ischanged evaluation on a record collection variable.

  4. my flow workaround could be leveraged in implementing a fix to this issue in the apex code.

  5. i also support the ability to turn off the currency conversion, we would prefer the users see and work in the record currency in our use case.

Masterspazz avatar Dec 03 '21 07:12 Masterspazz