Formula is not updating

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

    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
    • 472

    #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,
    CEO of Eblasoft
    EspoCRM Expert since 2014
    Full Stack Web Developer since 2008
    Creator of Numerous Successful Extensions & Projects​

    Comment

    • Ashif Malayil
      Senior Member
      • Dec 2023
      • 171

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

      Comment

      • rabii
        Active Community Member
        • Jun 2016
        • 1250

        #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
        Web Dev

        Comment

        • esforim
          Active Community Member
          • Jan 2020
          • 2204

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

          description = "Full Settlement"

          Comment

          Working...