CA Service Management

Expand all | Collapse all

CA SDM Change Calendar Script Error

Jump to Best Answer
  • 1.  CA SDM Change Calendar Script Error

    Posted 06-10-2015 12:14 PM

    We've encountered an odd issue with our change calendar, and I cannot put my finger on exactly what is causing the issue. It appears as though there's an issue with the script that generates the calendar view.


    • Leaving it with the default date it populates on load (May 31st to July 4th) it simple sits waiting, the hourglass spinning away merrily in the top corner.
    • If I select List view, it displays without issue without modifying the filter.
    • However, If I shorten the date window to start June 8th, leaving the end date of July 4th, it displays the calendar normally...

    Note: This is occurring in CA SDM 12.7


    While attempting to troubleshoot the issue I found the following in the console log:


    Uncaught TypeError: Cannot read property 'count' of undefined

    createCalendarCellsArray @ schedule.js:3071

    buildNdayCalendar @ schedule.js:1998

    ndayViewButton @ schedule.js:1269

    setupSchedule @ schedule.js:1181

    onload @ pdmweb.exe?SID=2039845639&FID=311530907&OP=SEARCH_RETURN_ALL&FACTORY=chg&HTMPL=list_chgsched.htmpl&…:600

    find_build_menubar_onload @ std_head.js:5207

    searchFilterOnload @ std_list.js:418

    DrawGrid_onload @ std_list.js:5314

    do_this_onload @ std_head.js:15854


    • We do have small customizations to the list_chgsched.htmpl file, to adjust the color scheme. Beyond that no other modifications have been made to any of the files around the change calendar specifically.
    • We have recently done some minor updates to our change process, which resulted in some additional statuses being added.
      • These were all tested in our Dev environment without issue. And Change calendar is not displaying the same behavior in Dev.



    Has anyone seen this type of behavior before? Or would anyone have any recommendations on what to verify, or what may be contributing?

  • 2.  Re: CA SDM Change Calendar Script Error

    Posted 06-10-2015 01:08 PM

    Just an additional note. I pulled the files from the Site/Mods folder and confirmed the Change calendar loads normally. Playing around with the code I've isolated it to this part which replaces the oringal CA code. This customization comes from before my time managing this tool. I'm not sure what caused this to fail.


    function setSchedEvents( chg )
      var grpnum;
        grpnum = schedGroup_apr;
      else if(chg.status=='RFC')
        grpnum = schedGroup_rfc;
      else if(chg.status=='ACABA')
        grpnum = schedGroup_acaba;
      else if(chg.status=='REJ')
        grpnum = schedGroup_rej;
      else if(chg.status=='COSUB')
        grpnum = schedGroup_cosub;
      else if(chg.status=='COWIP')
        grpnum = schedGroup_cowip;
      chg.schedEvent( grpnum, chg.sched_start_date, chg.sched_end_date );


    This is the original code that it replaced:


    function setSchedEvents( chg )
      var grpnum;
      switch( chg.chgtype - 0 ) {
        case 100: grpnum = schedGroup_std;  break;
        case 300: grpnum = schedGroup_emer; break;
        default:  grpnum = schedGroup_norm; break;
      chg.schedEvent( grpnum, chg.sched_start_date, chg.sched_end_date );

  • 3.  Re: CA SDM Change Calendar Script Error
    Best Answer

    Posted 06-10-2015 04:03 PM

    It may be that in wider date range you have some changes that are in particular status and for that status grpnum is undefined, try to set default grpnum when initializing this variable. Also you should check maybe there is some new change statuses that are not listed in you modification.

  • 4.  Re: CA SDM Change Calendar Script Error

    Posted 06-11-2015 12:29 PM

    Seems that everytime I tested in Dev environment the records in the time span just happened not to be in the status causing the issue..... "Fail at testing!"


    I added the extra statuses and corresponding color scheme and low and behold it started working normally...


    Thanks for pointing out the obvious that was staring me in the face!