Announcements
I am facing this issue when clicking on import button. What is the best solution
clicked method is given below
void clicked()
{
#define.count1(10)
#AviFiles
System.Exception ex;
SLJmgAttendanceDataImport attendanceDataImport = new SLJmgAttendanceDataImport();
//ImportUtility.Import importObj;
ImportUtilityZKK.Import importObj;
int rowsAffected = 0;
Filename fileName;
SLTimeImportTable slTimeImportTable;
SLJmgAttendanceImport slAttendanceImport;
SLAIFTimesheetImport slAifAttendanceImport;
//super();
PRLPayrollParameters payrollParameters = PRLPayrollParameters::find();
NoYes useOldEmployeeId = NoYes::No;
SysOperationProgress progress = new SysOperationProgress(1, true);
progress.setCaption("Attendance import is in progress");
progress.setAnimation(#AviUpdate);
progress.setTotal(#count1);
try
{
if ((PayrollPayCycleLookup.valueStr() != "" && PayrollPayPeriodLookup.value() != 0 ) || MultiplePayCycleCheckBox.value())//&& JmgProfileId.valueStr() != "")
{
if (ImportFromUtility.value() == true)
{
useOldEmployeeId = payrollParameters.SLUseOldEmployeeIdOnImport;
slAifAttendanceImport = new SLAIFTimesheetImport();
slAifAttendanceImport.setMultiParms(PayrollPayPeriodLookup.value(),
fileName,
LocationBased.selection(),
MultiplePayCycleCheckBox.value(),
useOldEmployeeId);
slAifAttendanceImport.importAndParseAttendanceFromUtility();
rowsAffected = slAifAttendanceImport.transferImportTableIntoExcelData();
info(strFmt("%1 records imported Successfully!", rowsAffected));
/*
importObj = new ImportUtilityZKK.Import();
fileName = importObj.ReadImportConfig(curext(), sessionId(), curUserId());
if (fileName != "")
{
delete_from slTimeImportTable
where slTimeImportTable.UserId == curUserId()
|| slTimeImportTable.SessionId == sessionId();
//where slTimeImportTable.SessionId == sessionId();
progress.setCount(10);
importObj.ParseAttendanceFile();
//rowsAffected =importObj.InsertIntoAX(PayrollPayPeriodLookup.value());
rowsAffected = SLAIFTimesheetImport::ImportAttendance(PayrollPayPeriodLookup.value(), fileName, LocationBased.selection(), curUserId(), MultiplePayCycleCheckBox.value(), payrollParameters.SLUseOldEmployeeIdOnImport);
delete_from slTimeImportTable
where slTimeImportTable.UserId == curUserId()
|| slTimeImportTable.SessionId == sessionId();
info(strFmt("%1 records imported Successfully!", rowsAffected));
}
else
{
info("Failed to import records!");
}
*/
}
else
{
attendanceDataImport.parmFileName(SLJmgAttendanceImportFile.Filename);
attendanceDataImport.parmAttendanceFileInfo(SLJmgAttendanceImportFile);
attendanceDataImport.parmPayPeriod(SLJmgAttendanceImportFile.PayPeriod);
//
attendanceDataImport.parmLocationBased(LocationBased.selection());
////
attendanceDataImport.parmMultiplePayCycle(MultiplePayCycleCheckBox.value());
attendanceDataImport.run();
//super();
}
}
}
catch(Exception::Info)
{
ex = CLRInterop::getLastException();
info(ex.ToString());
}
//SLJmgAttendanceExcelData_ds.executeQuery();
//element.updateDesign();
}
First of all I would like to thank you for correcting me. After your guidance I have edited my post now you can understand my code easily. By the way after applying your suggestion my issue has been resolve.
Thank you
Please recompile the form. If it doesn't find any compilation errors, run the form again. If it finds compilation errors, fix them and compile the code once more.
By the way, your code lost line indentation and therefore is difficult to read because you pasted it in a wrong way. Next time, please switch the the rich formatting view and use Insert > Insert Code.
And what are you trying to achieve by catch(Exception::Info)? It doesn't make sense to me.
I changed the category of this thread from Human Resources and Payroll to Development / Customization / SDK.
André Arnaud de Cal...
294,161
Super User 2025 Season 1
Martin Dráb
232,942
Most Valuable Professional
nmaenpaa
101,158
Moderator