I would like a field which is a coloured tile, the colour of the tile changes depending on the workflow state the item is at in the workflow.
I think this is a computed field. I have tried to copy some code I have seen and change it. This is the code I am trying but it errors. I see from the scripting page that descriptor.workflowState should give me the current state of a workflow. that is where I get stuck. I can't sucessfullt use descriptor.workflowState and I don't know if there is a better value I can use to compare against.
This is what I have so far......
Any pointers?
VAR STATE = descriptor.workflowState;
(CASE WHEN (STATE = DOCUMENT_CREATED) THEN '<span style="text-align:center; line-height:30px; color:yellow; background:yellow; width:50px; float:left; height:25px;">YELLOW</span>' WHEN (STATE = INSTALLATION_ARRANGED) THEN '<span style="text-align:center; line-height:30px; color:cyan; background:cyan; width:50px; float:left; height:25px;">CYAN</span>' WHEN (STATE = INSTALL_STARTED) THEN '<span style="text-align:center; line-height:30px; color:red; background:red; width:50px; float:left; height:25px;">RED</span>' WHEN (STATE = INSTALL_STARTED_ERRORS ) THEN '<span style="text-align:center; line-height:30px; color:red; background:red; width:50px; float:left; height:25px;">RED</span>' WHEN (STATE = INSTALL_COMPLETE) THEN '<span style="text-align:center; line-height:30px; color:GREEN; background:GREEN; width:50px; float:left; height:25px;">GREEN</span>' WHEN (STATE = SIGN_OFF) THEN '<span style="text-align:center; line-height:30px; color:blue; background:blue; width:50px; float:left; height:25px;">BLUE</span>' ELSE '<span style="background:white; color:white; width:50px; float:left; height:25px;">WHITE</span>' END )
OK so now from another post http://forums.autodesk.com/t5/Autodesk-PLM-360/Workflow-State/m-p/4299260/highlight/true#M1714 I read computed fields only support SQL and HTML not Javascript
So do I create a script that finds descriptor.workflowState then put that value as a field in the item. then compare that field with my case from above?
Hi Tim,
Yes, you would have to pull the value over from the workflow to the item tab (hidden / admin section would work great for this) them you could use this field in your computed filed to report on.