Hi everybody
We are running AX 2012 R3.
We are facing a strange way of working with the function 'Post the approved Timesheet".
1. Problem we had but which was solved in July : When we launched the function we got a message : Error executing code. Empty class object does not have the method main. We discover that the class TSTimesheetAutoPostBatch was not existing in our system
2. To fix this I installed the hot fix 4037381
Now the class is present in the system.
3. But now I have a new problem.
When I click on the function, the input screen opens but when I click on OK nothing occurs. I mean no approved Timesheet are posted.
4. TO understand, I copied the code on the class'run method in a new job
static void Job1(Args _args)
{
TSTimesheetTable timesheet;
while select timesheet
where timesheet.ApprovalStatus == TSAppStatus::Approved
&& timesheet.PostStatus == TSPostStatus::NotTransferred
{
try
{
if (timesheet.validateBudget())
{
timesheet.createCommitmentCostRecords();
TSTimesheetsPost::post(timesheet);
}
}
catch
{
Global::exceptionTextFallThrough();
}
}
}
5.I lauched it an approved Timesheet where psoted.
If you had an idea of why, I woul really appreciate.
Thank's in advance
Christophe