Unable to Set Amount Fields When Creating or Updating Invoice via Workflow Formula

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Laimonas
    Senior Member
    • May 2021
    • 230

    #1

    Unable to Set Amount Fields When Creating or Updating Invoice via Workflow Formula

    Hi,

    I'm having an issue with the "amount", "grandTotalAmount", "discountAmount", and "taxAmount" fields when creating an Invoice using a workflow formula.

    For example, when creating an Invoice from a Quote, all other fields transfer correctly - but these amount fields are always set to 0, no matter what values I include in the formula.

    The same thing happens when I try to update an existing Invoice: even though the related Invoice Item values are updated correctly, the amount fields remain unchanged. They only update if I manually open the Invoice and change the item values - then the amounts are recalculated.

    Has anyone else experienced this? How did you resolve it?

    Thanks in advance!
  • yuri
    EspoCRM product developer
    • Mar 2014
    • 9487

    #2
    Hi,

    Thse fields are calculated on save. They cannot be set.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • Laimonas
      Senior Member
      • May 2021
      • 230

      #3
      Thanks for the reply.

      What would be the correct way to create an Invoice using a workflow so that all data - including the amount fields - is populated correctly?

      Is there a specific step or workaround needed to make sure the amounts are calculated and displayed properly?

      Appreciate any guidance!

      Comment

      • yuri
        EspoCRM product developer
        • Mar 2014
        • 9487

        #4
        I'm not sure if it's possible other than writing a hook that will perform after the built-in hook (can be ordered with the order parameter).
        If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

        Comment

        • dreginald
          Senior Member
          • Sep 2018
          • 161

          #5
          You can workaround by creating new currency fields and writing formulae in workflows to get the values

          Comment

          Working...