Method Community

 

SQL - Grid font color

Last post 07-17-2017 1:28 PM by mraley. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 07-10-2017 5:40 PM

    • mraley
    • Not Ranked
    • Joined on 07-10-2017
    • Posts 3

    SQL - Grid font color

    I am looking for the SQL code to set a font color in an ActivityStatus field that is rendering in a grid.

    If the activity is set to "Not Started" then it should show in the grid red

    If the activity is set to "Completed" then it should show in the grid green

    In the advanced properties of the column ActivityStatus (alias: Status) I entered the folowing but get an error generating grid

    CASE WHEN viewActivity.ActivityStatus = 'Not Started' THEN '<font color="red"><b>' + ActivityStatus + '</b></font>' WHEN viewActivity.ActivityStatus = 'Completed' THEN '<font color="green"><b>' + ActivityStatus + '</b>' ELSE '<font color="black">' + Entity + '</font>' END)



  • 07-17-2017 11:09 AM In reply to

    • mraley
    • Not Ranked
    • Joined on 07-10-2017
    • Posts 3

    Re: SQL - Grid font color

    Is there anybody... out there?

  • 07-17-2017 12:23 PM In reply to

    Re: SQL - Grid font color

    Hi there mraley,

    Looking at your SQL there - the syntax is correct. If this was copy pasted exactly as is, however - You are missing an opening Bracket before the Query to match the ending one

    Try the same query - with the addition of an opening bracket Before CASE WHEN - this should do what you want it to!

    You are also missing a closing </font> tag after the 'Completed' status case - but this shouldnt be preventing the grid from loading.

    Thanks mraley!

    -Ben

    Ben Hargreaves
    Senior Support Specialist
    Method:CRM
    b.hargreaves@method.me
    Toll Free: 1.888.925.6238
    Local & Overseas: 416.847.0400
    Fax: 416.640.6027
  • 07-17-2017 1:28 PM In reply to

    • mraley
    • Not Ranked
    • Joined on 07-10-2017
    • Posts 3

    Re: SQL - Grid font color

    Thank you...worked perfect. I knew it was something I missed.

Page 1 of 1 (4 items)