Want to get rid of Google Ads, click here.
  • Section Widget

  • Recent Article Comments Widget

    drjf4

    I have picked up a copy of the new book. (Also own a copy of the 6.2 version.) I have started... Go to last post

    New book by Mike Sanders: Service Manager 9 Tailoring Techniques

    drjf4 on 2012-02-03
  • How to conditionally load a file in the background using JavaScript

    Following JavaScript can be used to load a file based on conditions.

    1: Save this code in a JavaScript library called JSlib (or whatever you choose just remember to change references)
    Code:
     
    function loadFileFromSchedule(schedule)
    { 
    var rteReturnValue = new SCDatum(); var rteNames = new SCDatum(); rteNames.push("record"); var rteValues = new SCDatum(); rteValues.setType(8); rteValues=system.functions.insert(rteValues, 0, 1, schedule); system.functions.rtecall("callrad",
    rteReturnValue, "bgload", //RAD app name rteNames, rteValues, false); //false to run in same thread, true to run in new thread
    return true;
    }
    2:
    Code:
    if (true)
    {
    system.library.JSlib.loadFileFromSchedule(vars["$L.schedule"]);
    }
    To use this do following:
    • Goto database manager
    • Rigth click and select Import/Load
    • Select the file to load (remember must be on a path accessible to the server)
    • Click LoadBG
    • Choose the parameters for the schedule, make sure it in future
    • Click LoadBG to make the schedule
    • Via database manager find the schedule record
    • Remove bgload from the field Application
    • In javascript paste code 2
    • Save the schedule

    NOTE: The bgload application in pre SM 7.10 has a bug that cause it not to work so if you are running SC 6.x or SM 7.0.x then you need to load the application from a 7.10 server.
  • Google search

    Google
     
  • Support ServiceCenter Resources - Make a donation

    Acceptance Mark