根据记录中某个域值来设定视图行的颜色

 1.新建一个form命名为“fProfColor”用于编辑profiledocument,form设计如图:

其中“$txtColor”域为计算域,其value为:
"color0:=/"00ffffff/":/"00000000/";
color6:=/""+bColor6+"/":/""+fColor6+"/";
sD:=@Date(txtDueDate);
eD:=@If(txtCompletedDate=/"/";@Date(@Now);@Date(txtCompletedDate));
@If(txtCompletedDate=/"/" & eD<=sD;color0;
@Do(
days:=(eD-sD)/86400;
color1:=/""+bColor1+"/":/""+fColor1+"/";
color2:=/""+bColor2+"/":/""+fColor2+"/";
color3:=/""+bColor3+"/":/""+fColor3+"/";
color4:=/""+bColor4+"/":/""+fColor4+"/";
color5:=/""+bColor5+"/":/""+fColor5+"/";
days1:="+@Text(DelayedDays1)+";
days2:="+@Text(DelayedDays2)+";
days3:="+@Text(DelayedDays3)+";
days4:="+@Text(DelayedDays4)+";
days5:="+@Text(DelayedDays5)+";
@If(days1!=-1&days<=days1;color1;
days2!=-1&days<=days2;color2;
days3!=-1&days<=days3;color3;
days4!=-1&days<=days4;color4;
days5!=-1&days<=days5;color5;
color6)
))"

2.添加一个Action在menu中或view显示,用来打开profiledocument:
 Dim ws As New NotesUIWorkspace
 Dim db As NotesDatabase
 Dim profDoc As NotesDocument
 Dim saveFlag As Variant
 
 Set db = ws.CurrentDatabase.Database
 Set profDoc = db.GetProfileDocument("fProfColor")
 saveFlag =  ws.DialogBox("fProfColor",True,True,False,False,False,False,"Set color for Actions",profDoc,True,False,False)
 If saveFlag=True Then
  Call profDoc.Save(True,False)
 End If

3.视图设置
插入新列到视图第一行,设置列属性。
在Column info页中设置title为“Color(hidden)”,勾上“Use Value as color”和“User definable”选项,设置"Profile document"为“fProfColor”。
在Advance页中设置name为“$txtColor”, 勾上“Hide Column”选项。
最后给该列随便设个value,如@UserName.

4.效果图

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值