Announcement

Collapse
No announcement yet.

Formula is not updating

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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')
    );​

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


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

      Comment


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

        Comment


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

          description = "Full Settlement"

          Comment

          Working...
          X