tnzabo
27th March 2008, 22:21
I'm having an issue with a customized print session running in a job. The job runs fine. The report creates a flatfile and it is there after the job runs. However, the data on the report is incorrect?? I don't understand at all why??? I can log into Baan on the server as the job user and manually run the session and the report shows correct data. As soon as I run the session through the job the report created has incorrect data! What could be causing this?
Any ideas??
Thanks - NikkiZ
David Eagar
28th March 2008, 04:15
Have you checked the session settings within the job itself (dates, times, ranges etc)? I find these get 'stuck' sometimes and don't update
sukesh75
28th March 2008, 10:23
Does your customized print session has any date fields in it? When there is a date field in any session that is added to a job, the system asks if you want to consider the difference between the dates on the field and current date. Could this be the issue?
sk
tnzabo
28th March 2008, 15:38
I do have a date range and I have said yes to consider the change in the dates because this job will run weekly for the past 6 days. When the job runs it creates a flatfile with the date range in the name of the file and that is correctly named so I know the dates are changing. Also - the data select is correct, the project and invoice information are there and good. The dollar values are where the issue is. They don't get picked up for some reason.
Like I said, when I run it manually as the job user on the Baan server everything is good so that to me doesn't say it's a code issue. I'm not sure what to do. Friday's are the day this job is scheduled to run so I guess I'll be running it manually today.
thanks - Nikkiz
sukesh75
29th March 2008, 10:09
Hi,
How are you activating the job? Are you calling the job from the prompt or keeping the Job Session open in a "waiting" mode? Is the job user a super user with admin privileges?
Is this happening with another job (using a different job to run this session) as well?
sk
tnzabo
31st March 2008, 16:54
I'm using the Windows task scheduler to activate the job and yes, the user is a super user. If I add this session to another job, same results. Doesn't matter what job I add the session to. I run it manually as the same user and the report is correct, once it's run in the job no go. :confused: Don't get it. And I checked the company and it's running in the correct company.
thanks for the questions.
Nikkiz
sukesh75
1st April 2008, 15:03
Since you are running the job from the scheduler, you must be calling the job from command prompt. Can you try activating the job from within the Baan session ? This is just to rule out any problem with calling the session through a command from the prompt.
sk
tnzabo
1st April 2008, 16:07
I've never done that before. I have more of a UNIX background with Baan - 10 yrs working on a UNIX box using crontab to schedule jobs. When I came here it was in Windows and they used task scheduler and I've been told that it is more reliable than the job daemon. I'm not sure what you mean by activating the job through the session? Please explain. Thanks Nikkiz
vinceco252
1st April 2008, 16:14
Nikki,
I think he's talking about executing it the way you are when it is working (i.e., using the activate jobs session (ttaad5203m000 from the menu browser).
Vince
tnzabo
1st April 2008, 16:54
same thing happens - when I activate the job via ttaad5203m000 all zeroes in the value fields. Good Stuff!~!
sukesh75
2nd April 2008, 12:06
Nikki,
I think you have successfully crossed over to the "Beyond Strange" territory. One last thing i could think of is the default currency of your company. In session Maintain Companies {ttaad1100m000}, what have you defined as the Default Currency of the Company? I dont know if its connected to that but since you are in the "Beyond Strange" area, the solutions got to be beyond strange...
sk
learner
3rd April 2008, 00:10
Hi,
I too encountered the same sort of a issue sometimes back on a cust. session, and on carefull investiogation we found that certain piece of code was written in function where the progress bar use to initilaise, now when you run a session within job, internally it wont initialise progress bar and thus any code like assigning values to variables etc within that function wont even execute.
So check for 2 things :
1) is any stuff written within initialise progress bar function within session logic ? if yes then probabbly when session runs via job the code never gets executed.
2) if first one does not solve ur issue, then put the script in debug mode and manually activiate the session and debug it for small range.
Regards
Learner :D
tnzabo
7th April 2008, 20:40
learner - you are awesome - I was thinking, I wish I could debug the dang code whilst in a job!!! Duh! So - I did what you suggested and it seems that some variables are not being set in my init.form section....I'm guessing this is because it's a job and form never really initializes because it's not officially displayed???
WooHoo!!
Update: - That's what it was!!! My job is now running and my report has the correct values in it!!! Thank You all!!