Forum Discussion

BuildPro's avatar
BuildPro
Qrew Captain
3 years ago

Help with formula (colors)

Getting this message:






[BOARD RATE]


var text ButtonColor = Case([CP - DW.2 BOARD RATE LABOR ONLY $]>0,
"#e600e6");

var text WordsColor = Case([CP - DW.2 BOARD RATE LABOR ONLY $]>0,"BLACK");


// Begin button style
var text bgcolor = $ButtonColor;
var text txtcolor = $WordsColor;
var text style = "style=\"text-decoration: none; text-align: center; background:" & $bgcolor & "; \nwidth: 20px; \nheight: 14px\nborder-radius: 5px; padding: 5px 5px; color: " & $txtcolor & "; display: inline-block; font: normal 700 24px/1 \"Calibri\", sans-serif; text-shadow: none;";
// End button style


"<div "& $style &">" & [CP - DW.2 BOARD RATE LABOR ONLY $] & "</div>"

//"<div " & $style & " " & [CP - DW.2 BOARD RATE LABOR ONLY $] & "</div>"

------------------------------
BuildPro
------------------------------

7 Replies

  • try this.    Use IF in that situation as opposed to CASE.

    var text ButtonColor = IF([CP - DW.2 BOARD RATE LABOR ONLY $]>0,
    "#e600e6");

    var text WordsColor = IF([CP - DW.2 BOARD RATE LABOR ONLY $]>0,"BLACK");

    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------
    • BuildPro's avatar
      BuildPro
      Qrew Captain
      var text ButtonColor = IF([CP - DW.2 BOARD RATE LABOR ONLY $]>0,"BLUE");
      var text WordsColor = IF([CP - DW.2 BOARD RATE LABOR ONLY $]>0, "black");

      ------------------------------
      BuildPro
      ------------------------------
      • BuildPro's avatar
        BuildPro
        Qrew Captain
        Found this:
        If( [CP - DW.2 BOARD RATE LABOR ONLY $] > 1,
        "<span style='background-color: #ffb3b3'>" & "$" & ToText(Round ([CP - DW.2 BOARD RATE LABOR ONLY $])),
        "$" & ToText (Round(([CP - DW.2 BOARD RATE LABOR ONLY $]))))

        this works kind-of
        ...how do we make the entire field red, leaving the $21 black?

        thx

        ------------------------------
        BuildPro
        ------------------------------
  • I don't think this is really what I am trying to do....please disregard.

    This is what I want the [BOARD COUNT] field to look like:
    If [CP - DW.2 BOARD RATE LABOR ONLY $]>0
    ....[BOARD COUNT] turn "green" and display the value (in white) from the [CP - DW.2 BOARD RATE LABOR ONLY $] field

    ------------------------------
    BuildPro
    ------------------------------