Hi,
Worker = HcmWorker::find(DirPersonUser::findUserWorkerReference(UserId));
or
public static Name userName(UserId _userId)
{
DirPartyName partyName;
partyName = DirPersonUser::userId2Name(this.UserId); //_UserId
if (!partyName)
partyName = (select firstonly Name from userInfo where userInfo.Id == this.UserId).Name;
if (!partyName)
partyName = this.UserId;
return partyName;
}
Worker = HcmWorker::find(DirPersonUser::findUserWorkerReference(UserId));
or
public static Name userName(UserId _userId)
{
DirPartyName partyName;
partyName = DirPersonUser::userId2Name(this.UserId); //_UserId
if (!partyName)
partyName = (select firstonly Name from userInfo where userInfo.Id == this.UserId).Name;
if (!partyName)
partyName = this.UserId;
return partyName;
}
public static UserID Worker2UserId(HcmWorkerRecId _WorkerRecId)
{
DirPersonUser personUser;
HcmWorker worker;
select User from personUser
exists join worker
where worker.Person == personUser.PersonParty
&& worker.RecId == _WorkerRecId;
return personUser.User;
}
Regards
No comments:
Post a Comment