Need to update repeat_untill field of schedule entry.

kunden
Kilo Explorer

i have been trying to update repeat_until field of schedule entry, since the record number is huge i am doing it through a BG script.

field type is date_integer

i have tried with this script for one record but it makes the field empty.

var gr = new GlideRecord("cmn_schedule_span");
gr.get("82b9458b0ad337022123a9b06c8156de")
gr.repeat_until = 20221212;
gr.update(); 

trying to figure out what kind of data does the date_integer type field takes.

1 REPLY 1

OlaN
Giga Sage
Giga Sage

Hi,

Messed around with it on my PDI, just to see how it could be done.

I successfully updated the value by using a string as input instead, but doing so in a scripts background also printed out some.. unexpected results.

so technically a gr.setValue('repeat_until', '20221212'); can work, but I would suggest to dive deeper into, if that has any side effects also.

Adding the scripts background info for reference.

Altering storage table [sh$business_calendar]: ALTER TABLE sh$business_calendar ADD `sh$context` VARCHAR(32), ADD `sh$operation` VARCHAR(40), ADD `sh$change_count` INTEGER, ADD `sh$first_recorded` DATETIME, ADD `sh$last_recorded` DATETIME, ADD `sh$sequence` VARCHAR(40), ADD `sh$first_txn_id` VARCHAR(32), ADD INDEX `papzrizf_source_primary`(`sys_id`) 
*** Script: Begin ResourceSupport.buildTableResources(sh$business_calendar, undefined)
*** Script: End ResourceSupport.buildTableResources
Altering storage table [sh$cmn_schedule]: ALTER TABLE sh$cmn_schedule ADD `sh$context` VARCHAR(32), ADD `sh$operation` VARCHAR(40), ADD `sh$change_count` INTEGER, ADD `sh$first_recorded` DATETIME, ADD `sh$last_recorded` DATETIME, ADD `sh$sequence` VARCHAR(40), ADD `sh$first_txn_id` VARCHAR(32), ADD INDEX `fjieyciv_source_primary`(`sys_id`) 
*** Script: Begin ResourceSupport.buildTableResources(sh$cmn_schedule, undefined)
*** Script: End ResourceSupport.buildTableResources
Cleaning up all schedules from cache
Slow business rule 'Update Schedule' on cmn_schedule_span:<span class = "session-log-bold-text"> </span>, time was: 0:00:00.685