Support » Plugin: Calculated Fields Form » Show a message if one calculated field is negative

  • Resolved gfdesign

    (@gfdesign)


    Dear support
    Is there any way to display a custom message if one calculated field is negative?
    Best regards and thanks for this plugin

    • This topic was modified 7 months, 1 week ago by  gfdesign.
Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @gfdesign,

    I’ll try to describe the process with an example:

    If your current equation is: fieldname1+fieldname2, you can edit it as follows:

    
    (function(){
    var result = fieldname1+fieldname2;
    return IF(0<=result;result;'Error Message Here');
    })()
    

    Best regards.

    Excuse my ignorance but I still don’t know where this code goes.
    Thanks for replying so fast 🙂
    Regards

    Plugin Author codepeople

    (@codepeople)

    Hello @gfdesign,

    The equations are entered into the “Set equation” attribute in the settings of the calculated fields:

    Best regards.

    I put your code here but does not work, not even the calculation

    Plugin Author codepeople

    (@codepeople)

    Hello,

    Your equation’s structure is wrong, the correct equation would be simply:

    
    (function(){
    var result=fieldname4*fieldname3-fieldname5;
    return IF(0<=result;result;'Error message');
    })()
    

    Best regards.

    @codepeople, I apreciate your good willing but when I replace my code by yours, the calculation stops working.
    This is like looks

    Any idea what I am doing wrong?
    Regards

    Plugin Author codepeople

    (@codepeople)

    Hello,

    My apologies, totally my fault, the correct code is:

    
    (function(){
    var result=fieldname4*fieldname3-fieldname5;
    return IF(0<=result,result,'Error message');
    })()
    

    Best regards.

    Thanks so much! Now it works.
    Once again, congratulations for your plugin.
    I just left my 5 stars review.
    Regards from Argentina

    Plugin Author codepeople

    (@codepeople)

    Hello @gfdesign,

    Thank you very much, it has been a pleasure to help you.

    Best regards.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Show a message if one calculated field is negative’ is closed to new replies.