• Resolved sakis11111

    (@sakis11111)


    hi guys.

    Is there any way to lock a caslculated field?

    In fact, I have 4 fields and one depends on the other. I am still trying to find a way to make them calculated and input fields at the same time but the main problem right now is to be asle to lock one of the 4 fields and leave only the other 3 to be able to change their values

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author CodePeople2

    (@codepeople2)

    Hello @sakis11111

    If you have four calculated fields configured as editable (with the read-only option unticked) and you wish for one of them to no longer be recalculated once the user manually enters a value, simply tick the “If value entered manually, no evaluate equation” checkbox in its settings. This configuration allows all fields to remain editable and calculated simultaneously. However, for the field where you have selected this option, its value will continue to be calculated until the user enters a manual value, after which it will not be recalculated.

    Best regards.

    Thread Starter sakis11111

    (@sakis11111)

    Thank you for your answer Code.

    But the issue that I am facing is the reculculation of the locked field. I dont want this field to be reculculated.
    Also it has to be locked by the user everytime he needs to lock it.
    Is there any way to do the above?

    Plugin Author CodePeople2

    (@codepeople2)

    Hello @sakis11111

    In this case, you can emulate the process with a checkbox to lock the file calculation manually (do not tick the option: “If value entered manually, no evaluate equation”).

    For example, assuming the field is the fieldname3, whose equation is fieldname1+fieldname2 (or any other equation). Also, you have inserted the checkbox field fieldname4 with the text “lock the field”. Finally, if you want to avoid the dynamic calculation if the checkbox is ticked, please edit the equation (for this hypothetical case) as follows:


    (function(){
    if(fieldname4) return __ME__;
    return fieldname1+fieldname2;
    })()

    If the checkbox is ticked, the previous equation will return the own field’s value, or the mathematical operation result otherwise.

    Best regards.

    Thread Starter sakis11111

    (@sakis11111)

    Thank you Code. That worked. But I also need as way to calculate all the 4 calculated fields in a specific way.

    Let me explain:
    If I change the value of one field, the other fields must also change. This can be done already, so I am ok. But in equation I need different equations, depending on what field is locked. If for example the fieldname1 is locked, I need the equation fieldname2*fieldname3. But if fieldname2 is locked, I need the equation fieldname1*fieldname3.
    I would use the “IF” function but I am not sure how to do that because you already told me to use this one:
    (function(){
    if(fieldname4) return __ME__;
    return fieldname1+fieldname2;
    })()

    So, can i add more”IF” on that equation? If yes, how to do that?

    Thank you

    Plugin Author CodePeople2

    (@codepeople2)

    Hello @sakis11111

    In that case, you need to incorporate conditional statements in your equations. These conditions should check which checkbox fields designated for locking the inputs have been selected, and then perform the corresponding mathematical operations.

    If you require personalized project implementation, please feel free to contact us via the plugin website. Contact Us.

    Best regards.

    Thread Starter sakis11111

    (@sakis11111)

    thank you code

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘lock a field’ is closed to new replies.