Error executing code: FormFunctionButtonControl (data source) has no valid runable code in method 'Clicked'. Stack trace (C)\Forms\SLPRLAttendanceImportScreen\Designs\DesignList\btnImportExcelData\Methods\Clicked

pastedimage1631168405925v1.png

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());
////</SL-Zain SAXPR-103>
attendanceDataImport.parmMultiplePayCycle(MultiplePayCycleCheckBox.value());
attendanceDataImport.run();
//super();
}

}

}
catch(Exception::Info)
{
ex = CLRInterop::getLastException();
info(ex.ToString());
}

//SLJmgAttendanceExcelData_ds.executeQuery();
//element.updateDesign();
}

We discussed this problem in another forum. It seems that recompiling the code fixed it.

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. Secondly you are rite I have also asked that question on another forum just because I asked question in every forum to get help as soon as possible

Thank you