Friday, 3 May 2019

More JDE scheduler frustrations

I have my 300 jobs, the password is right, but not I have to “reset schedule” on all of them.  when I open any of the jobs, there is no "next schedule / 5 rows apprearing in the grid".  A screen shot is below.

There is probably a PO or something much more simple than what I'm about to explain, but hang on!


See how when I look at the above, they are no listing of future scheduled jobs (or past).

So I need to open the job [as above], use the form exit of "reset schedule", then press okay and save for every one!!  This is going to take ages.  In IT, it's simple, I don't do repetitive tasks...  I automate them.

You cannot run the schedule app (P91300) from IV or fast path, otherwise I’d be tucking into a orchestration based solution – that’d be nice and easy.

So, I totally need to go old school on this, lucky I have some tricks for old school.  Lucky I am old school.

Firstly, I looked at the code of W91300B to see if I could attach that form exit to the main screen, then use repeat for grid.  The code looked bad, and there were a bunch of if statements and about 40 parameters to the BSFN that does the work to reset the schedule, I was not feeling that brave.

Secondly, I stopped and started and changed scheduler servers and reset the master, this did not help.  I did some https://support.oracle.com searches that revealed nothing.

So I bought out – captain vb script!

set objShell = wscript.createobject("WScript.Shell")

Do until success = True
  Success = objshell.AppActivate("Schedule Jobs - [Job Schedule--Canberra, Melbourne and Sydney]")
  wscript.sleep 1000
Loop

wscript.sleep 100
wscript.echo "Reset these schedules"
m=0
do until m = 300
      wscript.sleep 500
      objshell.sendkeys "%m"
      wscript.sleep 500
      objshell.sendkeys "t"
      wscript.sleep 500
      objshell.sendkeys "{Enter}"
      wscript.sleep 500
      objshell.sendkeys "%o"
      m=m+1
loop


And ran this at the command line

cmd> wscript resetSchedule.vbs

This then smashed through my 300ish jobs without a schedule and created them, nice.    There are probably much better ways of doing this.

Remember that you need to match the screen name exactly, once you select one of the records.  You don't want it working on the wrong screen.  My title once I select a row from the main screen is "Schedule Jobs - [Job Schedule--Canberra, Melbourne and Sydney" as seen below: 


Success = objshell.AppActivate("Schedule Jobs - [Job Schedule--Canberra, Melbourne and Sydney]")

What you need to do is match the number of records you are going to select with the main counter in the loop.  Highlight all of the records from P91300 then hit select.

Now, run the script at the command line.

No comments:

Extending JDE to generative AI