
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2023 03:40 PM
The scheduled job called Auto Generate Time Cards uses a script include called TimeCardGenerator. What is interesting is that the script include has the ability to restrict which tables can generate time cards but there is no way to specify that in the scheduled job. I can update the script include and hardcode the tables I care about but I wanted to see if maybe I am missing something.
The generateFromConfig call doesn't allow you to specify the tables yet the generate function does.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-16-2023 09:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2023 04:16 PM - edited ‎11-04-2023 04:24 PM
It should work to create an ad-hoc class out of the OOB one, overwrite the relevant member method - updating the Scheduled Job code to:
;
(function () {
var TimeCardGeneratorOrg = Class.create();
TimeCardGeneratorOrg.prototype = Object.extendsObject(TimeCardGenerator, {
'U_ALLOWED_TABLES': ['<table name 1>', '<table name 2>'],
'_timeCardAllowedForTask': function (task) {
return TimeCardGenerator.prototype
._timeCardAllowedForTask.call(this, task, this.U_ALLOWED_TABLES);
},
});
new TimeCardGeneratorOrg().generateFromConfig(TimeCardConstants.CURRENT_WEEK);
})();
Of course you would use proper, real class names in place of <table name 1> and <table name 2>.
Even better stored in a property perhaps.
What this does is to "inject" the list of "allowed" tables mid-course.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2023 06:27 AM
Yeah, was hoping that perhaps I overlooked something in the OOB script include. It's odd to me that they built in this ability but didn't provide a way to use. I hate to update OOB code but perhaps I will have to.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2023 08:22 AM
You could just de-activate the OOB scheduled job and create a new one in place.
Also I'm sure the functionality is used somewhere.
Though I suppose the main filter they expect will be used, is marking the top task as being one for which time cards are generated or not.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-16-2023 09:45 AM
I ended up creating a property and then modified the script include.