Formula is not updating

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ashif Malayil
    Senior Member
    • Dec 2023
    • 259

    #1

    Formula is not updating

    I do have 2 fields Order value and Amount received. If Order Value is 5000 and Amount Received 5000, then i need to update 'type' as Full Settlement. This type is Enum field. But this formula is not effecting. How can i achieve this?

    ifThenElse(
    orderValue == amountReceived,
    entity\setAttribute('type', 'Full Settlement'),
    entity\setAttribute('type', 'advance')
    );​
  • eymen-elkum
    Active Community Member
    • Nov 2014
    • 481

    #2

    ifThenElse(
    orderValue == amountReceived,
    type = 'Full Settlement',
    type = 'advance'
    );​​

    Make sure 'Full Settlement' is defined as option for the enum field, because will not save if not listed on options already,
    EspoCRM Expert since 2015
    We build custom solutions & premium extensions
    Eblasoft Technology Solutions​

    Comment

    • Ashif Malayil
      Senior Member
      • Dec 2023
      • 259

      #3
      Yes, Full Settlement and Advance is there as a option in Enum.

      Comment

      • rabii
        Active Community Member
        • Jun 2016
        • 1392

        #4
        try this

        PHP Code:
        if (orderValue == amountReceived) {
            entity\setAttribute('type', 'Full Settlement')
        } else {
            entity\setAttribute('type', 'advance')
        }
        Maybe you have the value full settlement and it is translation is shown as Full Settlement
        Rabii
        EspoCRM Custom Development

        🔗 Portfolio & Builds

        Comment

        • esforim
          Active Community Member
          • Jan 2020
          • 2226

          #5
          Test it with the Sandbox.
          Try it with another field, for example the description field.

          description = "Full Settlement"

          Comment

          Working...