Ability to adjust exchange rate for BuyXFR or SellXFR

Bob B's Avatar

Bob B

28 Jun, 2020 02:41 AM

I'm using InvestFields to create a a transaction for a sell XFER - the XFER is to an account with a different currency. Is there a way to adjust the exchange rate? Basically, I need access to the splittxn that is created.

I've thought about creating a plain sell and then another separate parent/split transaction to effect the transfer. Is there a better (easier) way>

  1. Support Staff 1 Posted by Sean Reilly on 28 Jun, 2020 09:29 PM

    Sean Reilly's Avatar

    Hi Bob,

    I think using a SellXfr transaction is the way to go, by setting investfields.txnType to InvestTxnType.SELL_XFER.

    To adjust the exchange rate for that transaction you'll need to get the split from the ParentTxn that you pass in the call to InvestFields.storeFields(ParentTxn). You should be able to get that split by calling TxnUtil.getXfrPart(ParentTxn). By default InvestFields should be setting the default exchange rate from the currency objects for inter-currency transactions. If the InvestFields is for an existing inter-currency transaction it should re-use the same exchange rate.

    Thanks!
    Sean

    --
    Sean Reilly
    Developer, The Infinite Kind
    https://infinitekind.com

  2. 2 Posted by Bob B on 30 Jun, 2020 07:19 PM

    Bob B's Avatar

    Thanks - that helps

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac