Okay so I have the scheduler running, created a custom scheduled job via Extension folder, added lang file, got it all working and running fine. However, I am now trying to edit the file (custom/modules/scheduler/ etc where my custom schedule file was created but it’s not picking up my changes. I seem to recall seeing something, some place, about having to add the jobs directly (so not in custom) to a folder within the scheduler named _AddJobsHere, or it doesn’t get picked up correctly when changes are made to it. I can’t seem to find anything on that again, so I guess this is a two-fold question. Should I make changes within custom/modules/scheduler/filetorun.php or is there something different when altering an already created custom job file?
stick to this tutorial, it names the involved folder paths:
That is what I followed, and got it working. However now when I make changes to the custom/modules/schedulers/ext/scheduletasks/filename.php it doesn’t pick up any of the changes. Also, realize this one is a bit different on how it builds after QR&R. Typically, your file from extensions builds out an ext.php file and you can change the file on your custom job within the module. This one builds out a scheduledtasks.ext.php file within custom/modules/schedulers/ext/scheduledtasks/ but if you go in and make changes there, it doesn’t seem to be picked up either.
Also, any clue what the purpose is of the modules/Schedulers/_AddJobsHere.php file is for then? It’s been a while since I’ve gone in and played with schedulers so I’m just getting back into it, but that file stood out to me and I can’t seem to recall if you had to add the jobs there to make edits or not.
Hint: any directory with /ext/
in SuiteCRM is auto-generated during a QR&R, it is not where you should be changing things.
You should change the source files in custom/Extension
and then see the changes reflected in that file you are now changing, after a QR&R.
_AddJobsHere.php is the main file that declares the core schedulers, in the end of it you find the code that also loads the custom schedulers:
So you don’t have to change anything in that file, you just put in your changes through the Extension mechanism (custom/Extension), the QR&R aggregates all custom stuff into custom/modules/Schedulers/Ext
, and _AddJobsHere.php
“consumes” it.
okay so I did the following:
Using extensions/ created a new scheduled job did a rebuild it built out all the ext/ folders and such.
Now I need to go in and expand upon said job. Do I need to make the changes within the extensions folder, then r&r and have it fully rebuild out again… essentially overwriting what I build previously? The really odd part… I had made some changes after initial build (essentially what it does is monitors an inbound mailbox, then performs actions based on the email content) to where in a specific event (sender == blah) it creates a new record on a different module… That is working, and still working now, but I don’t see that code in any of the scheduler files.
You make the changes in the same file where you coded things initially, and yes, you need a new QR&R to make them effective, each time.
If you have a lost file somewhere doing things that you’re not understanding, try to remember some unique string you used there and just run a “find in files” throughout the entire code base:
cd /your/suitecrm/root/directory
grep -irn someUniqueString .
Looking more in detail I may have made a rookie mistake and made changes to the .ext file… so those changes were lost when I did an r&r! I appreciate the heads up and information, will rebuild it again… may have a couple of downloaded copies of it to rework from anyway.