Want to get rid of Google Ads, click here.
+ Reply to Thread
Results 1 to 4 of 4

Thread: How to debug javascripts using RAD Debugger

  1. #1
    Junior Member
    Join Date
    Mar 2008
    Posts
    6

    Default How to debug javascripts using RAD Debugger

    Do anyone have idea on how to use RAD Debugger to correct the javascripts in scriptlibrary. Please provide step by step approach.

  2. #2
    Administrator tommy's Avatar
    Join Date
    Nov 2001
    Location
    Copenhagen
    Posts
    4,272

    Default

    The easiest way if the scripts run in foreground is to use the print statement at strategic places in the scripts.
    Best regards Tommy
    Blog - - ITIL certified - Accredited Integration Specialist – HP OpenView Service Management

    Want to keep this site alive? Consider making a donation. Click here.

  3. #3
    Junior Member
    Join Date
    Mar 2008
    Posts
    6

    Default

    Thanks Tommy,

    I have created a javascript to run a batch process to update all calls in history as below. Any way to know if it will work fine?

    function batchUpdatetoCallbackContact()
    {
    var ret;
    var counter = 0;
    var incidentFile = new SCFile("incidents");
    var rc = incidentFile.doSelect("incident.id=\"" + sInteractionID + "\"");

    print("Processing - Please Wait...");

    while (rc == RC_SUCCESS)
    {
    if (incidentFile.callback_contact_fullname == null)
    {
    counter += 1;
    print("Processing Interaction(" + counter + "): " + incidentFile.sInteractionID);
    incidents.callback_contact_fullname = system.library.contacts.getOperatorFullName(incide nts.callback_contact);
    system.functions.rtecall("trigger", ret, 0);
    incidentFile.doUpdate();
    system.functions.rtecall("trigger", ret, 1);

    }

    if (incidentFile.contact_fullname == null)
    {
    counter += 1;
    print("Processing Interaction(" + counter + "): " + incidentFile.sInteractionID);
    incidents.contact_fullname = system.library.contacts.getOperatorFullName(incide nts.contact_name);
    system.functions.rtecall("trigger", ret, 0);
    incidentFile.doUpdate();
    system.functions.rtecall("trigger", ret, 1);

    }
    rc = incidentFile.getNext();
    }

    print("Batch Process Completed. " + counter + " processed.");
    }

  4. #4
    Administrator tommy's Avatar
    Join Date
    Nov 2001
    Location
    Copenhagen
    Posts
    4,272

    Default

    I see several issues with this script.

    1. sInteractionID is not initialised or set but you use it in the select statement.
    2. you start a while look but the select statement you have will only ever return one record (you update counter but it is not used anywhere)
    3. you should not use doUpdate() to update a record because it do not lock records or check if records are locked. resulting in potential dataloss. use doAction("save") and check return code.
    Best regards Tommy
    Blog - - ITIL certified - Accredited Integration Specialist – HP OpenView Service Management

    Want to keep this site alive? Consider making a donation. Click here.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts