• Resolved hheyhey568

    (@hheyhey568)


    Hello,
    I have a calculation in which fieldname1 is written 15 times in the equation.

    Now I want to change it to fieldname2. Is there a way in the CFF which can help me to replace fieldname1 with fieldname2 within CFF in one click?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @hheyhey568

    No, I’m sorry, you should replace the field’s name in the equation one by one. This is the importance of following good practices in the implementation of the equations. Defining variables at the beginning of the equation’s code allow you to replace the fields’ names in only one place.

    I’ll try to describe it with a hypothetical equation:

    
    (function(){
    var a = fieldname1, b = fieldname2;
    
    if(a < 100) return 2*b;
    if(a < 1000) return 3*b;
    if(a < 10000) return 4*b;
    if(a < 100000) return 5*b;
    return 10*b;
    })()
    

    In the previous equation, if I need to use different fields, the names of the fields would be replaced in only one place.

    Best regards.

    Thread Starter hheyhey568

    (@hheyhey568)

    Thank you.. next time it will follow this good practice.

    I have found out solution in my case by using Fx Editor , select the fieldname , right click on it and selecting change all occurrences and then insert the required field.

    Thank u once more.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Replace fieldname in Equation of Calculated Field’ is closed to new replies.