|

楼主 |
发表于 2010-1-19 13:21:23
|
显示全部楼层
可以结贴了,谢谢引导,已经成功,下面将完整的代码发出来,以供有这样需求的占在一线的兄弟姐妹们一共分享,
// 刷新工作台待办任务的函数
static procedure TSUPERVISE_RECORD_BROWSE_IMPROVE_VERIFY_FORM.refreshWorkDesktop(AContext: TContext);
const
// Biz:\COLLABORATION\CUSTOMDESKTOPFUNC.FUNC
cDesktopURL = 'Biz:\COLLABORATION\CUSTOMDESKTOPFUNC.FUNC'; // 'Biz:\COLLABORATION\DesktopFunc.Func'; //Biz:\COLLABORATION\MYTASKFUNC.FUNC
cTaskCenterURL = 'Biz:\COLLABORATION\TASKCENTERINFO.INFO';
cPanelInfoURL = 'Biz:\COLLABORATION\PANELINFO.INFO';
var
lBizObject: TBizObject;
i: Integer;
lContext: TContext;
begin
lContext := AContext.FindParentContext(BizSys.IL_PERSON); //人员环境 ; 查找某个隔离级的父环境
//在人员环境找工作台功能
for i:=0 to lContext.ChildCount-1 do
try
if (lContext.Children.Owner is TFunc) then //**********这边必须加上类型判断,不然会出错。
if SysUtils.SameText(cDesktopURL, (lContext.Children.Owner as TFunc).BizClassURL.BizURL.URL) then
begin
lBizObject := lContext.Children.Owner;
break;
end
except
end;
if lBizObject=nil then exit;
//在工作台功能上找任务中心信息
lContext := lBizObject.Context;
for i:=0 to lContext.ChildCount-1 do
try
begin
if SysUtils.SameText(cPanelInfoURL, (lContext.Children.Owner as TInfo).BizClassURL.BizURL.URL) then
begin
lBizObject := lContext.Children.Owner;
if lBizObject <> nil then
begin
lContext := lBizObject.Context;
for i:=0 to lContext.ChildCount-1 do
begin
try
if SysUtils.SameText(cTaskCenterURL, (lContext.Children.Owner as TInfo).BizClassURL.BizURL.URL) then
begin
lBizObject := lContext.Children.Owner;
//刷新数据集
if (lBizObject as TInfo).DataSetByID('TaskIndex').Active then
(lBizObject as TInfo).DataSetByID('TaskIndex').Refresh;
// Exit;
end;
except
end;
end; // end for
end; // end if
end; // end if
end;
except
end;
end; |
|