Public void attachments()
{
Filename fileName = @'D:\AX\Files.csv';
DocuRef docuRef,docuRefLoc;
DocuType docuType;
HcmWorker hcmWorker = HcmWorker::findByPersonnelNumber('123456');
DocuActionArchive docuActionArchive;
;
select docutype where docutype.ActionClassId == assNum(DocuActionArchive) && DocuType.TypeId == 'file' ;
docuRef.RefRecId = hcmWorker.RecId;
docuRef.RefTableId = hcmWorker.TableId;
docuRef.RefCompanyId = 'DAT';
docuRef.TypeId = docutype.TypeId;
docuRef.insert();
ttsBegin;
select forupdate docuRefLoc where docuRefLoc.RecId == docuRef.RecId;
docuActionArchive = DocuAction::newDocuRef(docuRefLoc);
docuActionArchive.add(docuRefLoc, fileName);
ttsCommit;
}
{
Filename fileName = @'D:\AX\Files.csv';
DocuRef docuRef,docuRefLoc;
DocuType docuType;
HcmWorker hcmWorker = HcmWorker::findByPersonnelNumber('123456');
DocuActionArchive docuActionArchive;
;
select docutype where docutype.ActionClassId == assNum(DocuActionArchive) && DocuType.TypeId == 'file' ;
docuRef.RefRecId = hcmWorker.RecId;
docuRef.RefTableId = hcmWorker.TableId;
docuRef.RefCompanyId = 'DAT';
docuRef.TypeId = docutype.TypeId;
docuRef.insert();
ttsBegin;
select forupdate docuRefLoc where docuRefLoc.RecId == docuRef.RecId;
docuActionArchive = DocuAction::newDocuRef(docuRefLoc);
docuActionArchive.add(docuRefLoc, fileName);
ttsCommit;
}
No comments:
Post a Comment