General information
Category:
Coding, syntax & commands
Thanks hips Nick and to Gerard who after reading his response i saw i could call my function and pass parameter my column name pexp ao it did the trick. I could then have as complicated algoritham in my UDF as a like. So this has done the job:
in Grid.Init
this.SetAll("DynamicForeColor",;
"thisform.displaycolor(pexp)","Column")
my custom method is displaycolor and accept 1 parameter pexp which is my Priority Expires datetime field.
Thisform.displaycolor method looks like this:
LPARAMETER Pexp
LOCAL lcRetValue
* RGB(0,128,0) green
* RGB(0,0,255) blue
* RGB(255,128,0) orange or RGB(255,255,0)
* RGB(255,255,0) red
IF TTOD(DATETIME())=TTOD(pexp)
DO CASE
CASE HOUR(pexp)-HOUR(DATETIME())>3
lcRetValue = 32768 && RGB(0,128,0) && green
CASE HOUR(pexp)-HOUR(DATETIME())=3
lcRetValue = 16711680 && RGB(0,0,255) && blue
CASE HOUR(pexp)-HOUR(DATETIME())<=2 AND HOUR(pexp)-HOUR(DATETIME())>1
lcRetValue = 33023 && = RGB(255,128,0) = orange or 65535 RGB(255,255,0) is yellow
CASE HOUR(pexp)-HOUR(DATETIME())<=1
lcRetValue = 255 && RGB(255,255,0) && red
ENDCASE
ELSE
IF TTOD(DATETIME()) > TTOD(pexp)
lcRetValue = 255 && RGB(255,255,0) && red
ELSE
lcRetValue = 32768 && RGB(0,128,0) && green
ENDIF
ENDIF
RETURN lcRetValue
All the best.
By the way this is for my Client/Server app with ORACLE as a backend.
Grid will refresh automatically every 30 sec. and give user an indication of what jobs are with higher priority.
Regards
Dejan
Sydney
Australia
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only