My favorite code snippet for reporting... what's yours? | Community
Skip to main content
Level 10
October 28, 2016
Question

My favorite code snippet for reporting... what's yours?

  • October 28, 2016
  • 18 replies
  • 3452 views

This is my favorite by far. It can be added to any Project, Task, Issue or Document Report or List view, and gives you a glimpse into the last update on the record including the first 140 characters, the user and the date of the update all in one cell. This can usually eliminate a few clicks into a record to find the latest update.

Just add a column into your view, switch to text mode and paste the following:

displayname=Latest Update

namekey=latest update

textmode=true

valueexpression=IF(LEN({lastNote}.{noteText})>140, CONCAT(SUBSTR({lastNote}.{noteText},0,139),"...(open for more) -- ", {lastNote}.{owner}.{name}," on ", {lastNote}.{entryDate}), IF(LEN({lastNote}.{noteText})>0, CONCAT({lastNote}.{noteText}," -- ", {lastNote}.{owner}.{name}," on ", {lastNote}.{entryDate})))

valueformat=HTML

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

18 replies

Level 2
December 12, 2016

Hi Greg,

Have you tried to modify this code? I was trying to show the Last Note:Note Text field and haven't gotten it to work. I have tried various versions of the below to lines of code.

image.namevalue=string(description)

image.valuefield=description

Below is my code:

image.case.0.comparison.icon=true

image.case.0.comparison.leftmethod=lastNote:noteText

image.case.0.comparison.lefttext=lastNote:noteText

image.case.0.comparison.operator=notblank

image.case.0.comparison.operatortype=string

image.case.0.comparison.righttext=

image.case.0.comparison.truetext=/static/img/r15/icons/casebuilder/light_grey.gif

image.namevalue=string({lastNote}.{noteText})

image.valuefield=lastNote:noteText

linkedname=direct

namekey=lastNote:noteText

querysort=lastNote:noteText

textmode=true

valuefield=lastNote:noteText

valueformat=HTML

Thanks,

Ali

Level 9
December 13, 2016

Hi Ali, here's my code which I've posted on another thread which I've found this really useful to get to see the last update without having to get into the project.

displayname=Last Update

image.case.0.comparison.icon=true

image.case.0.comparison.leftmethod=lastNote:entryDate

image.case.0.comparison.lefttext=lastNote:entryDate

image.case.0.comparison.operator=gte

image.case.0.comparison.operatortype=date

image.case.0.comparison.righttext=$$TODAY

image.case.0.comparison.truetext=/static/img/r15/icons/casebuilder/flag_green.gif

image.case.1.comparison.icon=true

image.case.1.comparison.leftmethod=lastNote:entryDate

image.case.1.comparison.lefttext=lastNote:entryDate

image.case.1.comparison.operator=between

image.case.1.comparison.operatortype=date

image.case.1.comparison.righttext=$$TODAY-7d

image.case.1.comparison.righttextrange=$$TODAY-1d

image.case.1.comparison.truetext=/static/img/r15/icons/casebuilder/flag_yellow.gif

image.case.2.comparison.icon=true

image.case.2.comparison.leftmethod=lastNote:entryDate

image.case.2.comparison.lefttext=lastNote:entryDate

image.case.2.comparison.operator=notnull

image.case.2.comparison.operatortype=date

image.case.2.comparison.righttext=

image.case.2.comparison.truetext=/static/img/r15/icons/casebuilder/light_grey.gif

image.namevalue=lastNote:noteText

linkedname=lastNote

namekey=view.relatedcolumn

namekeyargkey.0=lastNote

namekeyargkey.1=noteText

querysort=lastNote:noteText

shortview=false

textmode=true

valuefield=lastNote:entryDate

valueformat=HTML

Level 2
December 13, 2016
Thanks, Polly! This is exactly what I needed.
Level 2
April 6, 2018
Thank you for sharing your favorite code to shorten the last status update! I use something similar for the description but couldn't get it to work on the last note text - this is perfect! Leslie Stinson Viasat, Inc.
Level 2
May 2, 2019

this code does not seem to work anymore since the latest update. Has anyone tried to make it work again? It seems that the imag.namevalue=string(description) code is not working - thanks, Yannick

NRYNRAuthor
Level 10
May 2, 2019

Yannick, if you copied the code and pasted into this email, then I think the problem might be where the word "image" is missing the "e".

imag.namevalue=string(description)

Level 2
May 2, 2019

Thank you Narayan,

Unfortunately I typed it.

This is the full code I use for a customized view I created of our timeline so the project managers did not have to click on the task to see the description.

displayname=

image.case.0.comparison.icon=true

image.case.0.comparison.leftmethod=description

image.case.0.comparison.lefttext=description

image.case.0.comparison.operator=notblank

image.case.0.comparison.operatortype=string

image.case.0.comparison.righttext=

image.case.0.comparison.truetext=/static/img/r15/icons/casebuilder/light_blue.gif

image.namevalue=string(description)

image.valuefield=description

linkedname=direct

shortview=false

textmode=true

valuefield=description

valueformat=HTML

The code for the latest update works though. Also, it used to work before the latest WF update.

Thanks,

Yannick

Level 4
May 3, 2019

Hi, Yannick,

We reported this as a bug to Workfront, and they've made a fix to the extent that the circles show up now.

There are still flaws.

If you have two or more columns based on Task Description, the second one overwrites the first one. A fix to this is in the WF backlog, but not queued up for any work.

Also, the hover to show the content of the description doesn't work.

I'll reiterate that functionality. I think they forgot about the hover.

Best,

Alana