没重现问题,这是我的代码
procedure TMainForm.Button1Click(Sender: TObject);
var
lBizURL: TBizURL;
UserID,UserName: string;
lPerson: TorgUnit;
begin
lBizURL := TBizURL.Create;
try
lBizURL.URL := 'Org:\Person';
UserID:='cs2';
UserName:='测试2';
lPerson := OrgSys.OrgSystem.FindPerson(UserID);
if lPerson = nil then
begin
if jsDialogs.ConfirmBox('是否增加用户?'+#10+#13+'ID:'+UserID+' 用户名:'+UserName,'增加用户',1) then
begin
OrgSys.OrgSystem.CreateUnit(lBizURL, UserID, TBizObjectKind.boPerson, UserName);
end;
end;
finally
lBizURL.Free;
end;
end; |