Function Field 'Age' on Task table

Jane Stone
Kilo Guru

I want to take advantage of the new function fields in Quebec to create an 'Age' field on the Task table which would provide reporting with the number of days old an active record is. The problem I am having is that I am unable to work out the correct syntax to use for the current date in the datediff function. So far, everything I have tried gives me the message 'not a supported function'. I have tried the following:

now()
nowDateTime()
update()
GlideDate()
new GlideDateTime()
new Date().getTime()
Date()
gs.nowDateTime()

Does anyone know what the correct syntax is?

4 REPLIES 4

Dennis R
Tera Guru

When I use this as the function definition on the task table, it works fine for me. Make sure your field type is Duration.

glidefunction:datediff(now(),opened_at);

Is this what you're using?

Emily4
Tera Contributor

Hi Dennis - This works for me, but the age doesn't stop running when the ticket state is closed.. 
Is there a way to add an IF statement into that glide function? Thanks! 

Jane Stone
Kilo Guru

If I try this in the reports module, I still get the error that now is not a supported function. Perhaps the only way to configure this is on the table itself and not via the reports module.

find_real_file.png

I'm sorry, I thought you were talking about in the dictionary.

 

I don't think this is possible with the function fields feature of reporting. That feature is currently extremely limited. You could try putting it in as a feature request, it seems pretty obvious as something that needs to be added to me.

 

Sorry, wish I could be more help.