怎么会有两个信息呢?
那你改一下
const
cDesktopURL = 'Biz:\COLLABORATION\DesktopFunc.Func';
cTaskCenterURL = 'Biz:\COLLABORATION\TASKCENTERINFO.INFO';
var
lBizObject: TBizObject;
i: Integer;
lContext: TContext;
begin
lContext := Context.FindParentContext(BizSys.IL_PERSON); //人员环境
//在人员环境找工作台功能
for i:=0 to lContext.ChildCount-1 do
try
if SysUtils.SameText(cDesktopURL, (lContext.Children.Owner as TFunc).BizClassURL.BizURL.URL) then
lBizObject := lContext.Children.Owner;
except
end;
if lBizObject=nil then exit;
//在工作台功能上找任务中心信息
lContext := lBizObject.Context;
for i:=0 to lContext.ChildCount-1 do
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;
end;
except
end;