0
SalesQuotationId 및 Personnelnumber를 제공하는 CSV 파일을 받았으므로 find
메서드를 통해 SalesQuotation을 찾을 수있는 작업을 만들었습니다.Personnelnumber를 기준으로 HCMWorker RecId 필드 업데이트
SalesQuotationTable에는 RecId
의 HCMWorker
으로 저장된 필드가 있습니다. 문제는 CSV 파일에 인사 수만 있습니다. PersonnelNumber를 기반으로 HCMWorker의 RecId를 변경하는 방법을 찾을 수 없습니다.
static void UpdateHCMWorkerField(Args _args)
{
#File
CommaTextIo inFile;
Container con;
int i;
FileIOPermission permission;
FilePath readFile;
SalesQuotationTable salesQuotationTable;
SalesQuotationId quotationId;
str worker;
HcmWorker hcmWorker;
;
readFile = "File.csv";
permission = new FileIOPermission(readFile, #io_read);
permission.assert();
inFile = new CommaTextIo(readFile, #io_read);
inFile.inFieldDelimiter(",");
while (inFile.status() == IO_Status::Ok)
{
con = inFile.read();
quotationId = conPeek(con,1);
worker = conPeek(con,2);
salesQuotationTable = salesQuotationTable::find(quotationId,true);
if(salesQuotationTable && worker) {
ttsBegin;
// Obviously, this is not working working because I am trying to update the RecId field with a string value.
salesQuotationTable.WorkerField = worker;
salesQuotationTable.update();
ttscommit;
}
info("Done!");
}
}