[JS/AS] Storing values that persist between runs of scripts

I have written a number of Applescripts that use Applescript Properties to to store the values chosen by users in dialog boxes etc between successive runs of the script (in AS they persist until the script is recomplied).
I am investigating converting these scripts to JS to enable them to be used cross platform, and am slowly bringing myself up to speed with JS. However, I cannot see any obvious equivalent to AS properties.
Does any one have any advice on how they store user defaults, preferences etc between script runs. Any code fragments would be appreciated.
Many thanks, Nye

//NeonWithPrefs.jsx
//An InDesign CS3 JavaScript
//This script creates a "blend" or "graduation" from the selected object or objects.
//For more on InDesign scripting, go to
http://www.adobe.com/products/indesign/scripting.html
//or visit the InDesign Scripting User to User forum at
http://www.adobeforums.com
main();
function main(){
var myObjectList = new Array;
if (app.documents.length != 0){
  if (app.selection.length != 0){
   for(var myCounter = 0;myCounter < app.selection.length; myCounter++){
    switch (app.selection[myCounter].constructor.name){
     case "Rectangle":
     case "Oval":
     case "Polygon":
     case "GraphicLine":
      myObjectList.push(app.selection[myCounter]);
     break;
   if (myObjectList.length != 0){
    myDisplayDialog(myObjectList);
   else{
    alert ("Please select a rectangle, oval, polygon, or graphic line and try again.");
  else{
   alert ("Please select an object and try again.");
else{
  alert ("Please open a document, select an object, and try again.");
function myDisplayDialog(myObjectList){
var mySwatchNamesList = new Array;
var myLayerNamesList = app.documents.item(0).layers.everyItem().name;
for(var myCounter = 0;myCounter < app.activeDocument.colors.length; myCounter ++){
  //Do not add(); unnamed colors.
  if(app.activeDocument.colors.item(myCounter).name != ""){
   mySwatchNamesList.push(app.activeDocument.colors.item(myCounter).name);
for(var myCounter = 0;myCounter < app.activeDocument.mixedInks.length; myCounter ++){
  mySwatchNamesList.push(app.activeDocument.mixedInks.item(myCounter).name);
//New stuff for setting dialog box controls to the last-selected options.
//While the basic XML preferences-reading mechanisms are generic,
//significant handling has to be done by the dialog box to read and
//use the stored values.
//List of dialog box parameters for Neon.jsx:
//NumberOfSteps--integer
//FromStrokeColor--string
//FromStrokeWeight--double
//ToStrokeWeight--double
//FromStrokeTint--percent
//ToStrokeTint--percent
//LayerName--string
var myParameterArray = myGetDialogPreferences("NeonWithPrefs", ["NumberOfSteps", "FromStrokeColor", "FromStrokeWeight", "ToStrokeWeight", "FromStrokeTint", "ToStrokeTint", "LayerName"]);
//myPreferences is the XML object that should lead off the array.
var myPreferences = myParameterArray[0];
try{
  if(myParameterArray.length == 8){
   //If any of these conversions fails, we'll set the
   //values back to the defaults by handling the error.
   myNumberOfSteps = parseInt(myParameterArray[1]);
   if(myNumberOfSteps <=1){
    throw "Too few steps.";
   myFromStrokeColor = myParameterArray[2];
   myFromStrokeWeight = parseFloat(myParameterArray[3]);
   myToStrokeWeight = parseFloat(myParameterArray[4]);
   myFromStrokeTint = parseFloat(myParameterArray[5]);
   myToStrokeTint = parseFloat(myParameterArray[6]);
   myLayerName = myParameterArray[7];
  else{
   throw "Could not read from preferences file.";
catch(myError){
  //Default values.
  myNumberOfSteps = 12;
  myFromStrokeColorName = "Black";
  myFromStrokeWeight =12;
  myToStrokeWeight = .25;
  myFromStrokeTint = 100;
  myToStrokeTint = 10;
  myLayerName = "Layer 1"; 
//Now process the stroke color index.
myFromStrokeColorIndex = myGetIndex(mySwatchNamesList, myFromStrokeColor);
//Now process the layer index.
myLayerIndex = myGetIndex(myLayerNamesList, myLayerName);
//End of preference-gathering stuff.
var myDialog = app.dialogs.add({name:"Neon"});
with(myDialog){
  with(dialogColumns.add()){
   with(borderPanels.add()){
    with(dialogColumns.add()){
     staticTexts.add({staticLabel:"Number of Steps:"});
    with(dialogColumns.add()){
     //Updated.
     var myNumberOfStepsField = integerEditboxes.add({editValue:myNumberOfSteps});
   with(borderPanels.add()){
    with(dialogColumns.add()){
     staticTexts.add({staticLabel:"From:", minWidth:36});
    with(dialogColumns.add()){
     with(dialogRows.add()){
      with(dialogColumns.add()){
       staticTexts.add({staticLabel:"Stroke Color:", minWidth:100});
      with(dialogColumns.add()){
       //Updated, var name mySwatchIndex.
       var myFromStrokeColorMenu = dropdowns.add({stringList:mySwatchNamesList, selectedIndex:myFromStrokeColorIndex});
     with(dialogRows.add()){
      with(dialogColumns.add()){
       staticTexts.add({staticLabel:"Stroke Weight:", minWidth:100});
      with(dialogColumns.add()){
       //Updated.
       var myFromStrokeWeightField = realEditboxes.add({editValue:myFromStrokeWeight});
     with(dialogRows.add()){
      with(dialogColumns.add()){
       staticTexts.add({staticLabel:"Stroke Tint:", minWidth:100});
      with(dialogColumns.add()){
       //Updated.
       var myFromStrokeTintField = percentEditboxes.add({editValue:myFromStrokeTint});
   with(borderPanels.add()){
    with(dialogColumns.add()){
     staticTexts.add({staticLabel:"To:", minWidth:36});
    with(dialogColumns.add()){
     with(dialogRows.add()){
      with(dialogColumns.add()){
       staticTexts.add({staticLabel:"Stroke Weight:", minWidth:100});
      with(dialogColumns.add()){
       //Updated.
       var myToStrokeWeightField = realEditboxes.add({editValue:myToStrokeWeight});
     with(dialogRows.add()){
      with(dialogColumns.add()){
       staticTexts.add({staticLabel:"Stroke Tint:", minWidth:100});
      with(dialogColumns.add()){
       //Updated.
       var myToStrokeTintField = percentEditboxes.add({editValue:myToStrokeTint});
   with(borderPanels.add()){
    with(dialogColumns.add()){
     staticTexts.add({staticLabel:"Destination Layer:"});
    with(dialogColumns.add()){
     //Updated.
     var myLayersMenu = dropdowns.add({stringList:myLayerNamesList, selectedIndex:myLayerIndex});
var myResult = myDialog.show();
if(myResult == true){
  //Get the values from the dialog box controls
  var myNumberOfSteps = myNumberOfStepsField.editValue;
  var myFromStrokeColor = mySwatchNamesList[myFromStrokeColorMenu.selectedIndex];
  var myFromStrokeWeight = myFromStrokeWeightField.editValue;
  var myToStrokeWeight = myToStrokeWeightField.editValue;
  var myFromStrokeTint = myFromStrokeTintField.editValue;
  var myToStrokeTint = myToStrokeTintField.editValue;
  var myLayerName = myLayerNamesList[myLayersMenu.selectedIndex];
  myDialog.destroy();
  //Write dialog preferences file.
  //Change the values in the XML preferences object.
  myPreferences.NumberOfSteps = myNumberOfSteps;
  myPreferences.FromStrokeColor = myFromStrokeColor;
  myPreferences.FromStrokeWeight = myFromStrokeWeight;
  myPreferences.ToStrokeWeight = myToStrokeWeight;
  myPreferences.FromStrokeTint = myFromStrokeTint;
  myPreferences.ToStrokeTint = myToStrokeTint;
  myPreferences.LayerName = myLayerName;
  //Write the values back to the XML file.
  myWriteXMLPreferences("NeonWithPrefs", myPreferences);
  //Apply the effect.
  myNeon(myObjectList, myNumberOfSteps, myFromStrokeColor, myFromStrokeWeight, myToStrokeWeight, myFromStrokeTint, myToStrokeTint, myLayerName);
else{
  myDialog.destroy();
function myNeon(myObjectList, myNumberOfSteps, myFromStrokeColor, myFromStr

Similar Messages

  • Apple Automator - Run Shell Script Application

    Morning, hope somebody can point of my error please.
    I'm attempting to create an Application wrapper for a minecraft server.
    I've done the following
    Automator > Application
    I've dragged in 'Run Shell Script'
    The Shell dropdown is '/bin/bash'
    The Pass input is 'as arguments'
    In the script I have '
    cd /Volumes/3Tb/Bukkit_live
    /usr/bin/java -Xmx2G -jar /Volumes/3Tb/Bukkit_live/minecraft_server.jar nogui
    Now when I run it through the automator app, it works fine, the server starts, however when I try and run it as a standalone application it does nothing ?
    Please help.
    Thanks in advance.
    Darren

    Best guess is that there is an environment variable in your Terminal session that does not exist when you are running an Automator workflow.
    You could try running an Automator workflow that does Run Shell Script with something like
    ( pwd
      id -a
      echo $#
      echo "$@"
      printenv
    ) >/tmp/automator.environment.txt
    Then do 2 things.  Run it within Automator and copy the /tmp/automator.environment.txt file someplace safe.  Next save it as an Automator app and run it that way.  Compare the 2 automator.environment.txt files and see if anything significant is different between the 2.
    This is just a guess (an educated guess, as this sort of thing has happened to others in the past when they see a difference between running a script interactively and running it as an embedded app).

  • How can I run a script last?

    Hiya,
    I have a single backup job running a single dataset. That single dataset has an include statement to include a dataset directory, which holds individual datasets for the several hosts I want to back up, each with potentially different parameters. This works well, the hosts back up in some order (I don't care), everything's happy.
    However, what I want to do is add a step on the end of this process to run a report on the admin server after all the backups are complete. That is, to run a script once, last.
    If I add an "after backup" command in the dataset, it runs it (as stated in the manual) on the client servers, after every backup, which is no good to me. I've tried creating a separate job and scheduling it at a lower priority a few minutes later than the backup job, but that seems to just run when it feels like it, I presume because there aren't any conflicts so why shouldn't it?
    Can anyone advise how I should be doing this?
    Related question... I've tried putting an "after backup" step on the Catalog backup job, but that appears to get run twice (I presume because there are two "include" steps in the catalog dataset)! Is this expected? How can I get it to just run once, after the catalog backup is complete?
    Thanks,
    David.

    Thanks Donna, but... no. It didn't work.
    We've actually purchased a license for OSB, so I've fired this question at our official support channel now, and they came back with the same answer at the same time (are you the Oracle techie looking at my problem, by any chance?). For the record here's (with some tweaks for readability in this context) what I've sent back in response to that article.
    From the article, I thought perhaps the following might do the trick:
    include dataset /Hosts {
    after backup optional "/usr/local/osb/pre-n-post after-fsd-hosts mail"
    But, from the log:
    2010/11/05.07:26:58 trouble parsing dataset in FSdaily line 1 - open brace appears where not allowed (OB dataset mgr)
    "010/11/05.07:26:58 offending line is "include dataset /Hosts {
    2010/11/05.07:26:58 trouble parsing dataset in FSdaily line 3 - bad nesting (OB dataset mgr)
    "010/11/05.07:26:58 offending line is "}
    So it appears I’m not actually allowed to do that. I don’t understand why that would be.
    The only other idea I have is to include a dummy backup step, backing up something really small (because OSB won’t let you run a backup without backing anything up - sigh!), tack a script onto that, and hope like heck OSB decides that it should run that last. All the documentation I’ve read gives the impression that datasets are all about scope, not order, so I’m not altogether confident that this will work. In any case, it seems a pretty kludgy way of doing it! And, given the next paragraph below, I’m not all that sure it’ll work in any case.
    My idea of scheduling a catalog backup for five minutes later than the client backups, with a lower priority, so that it runs when the client backups finish, also has a flaw - if I use two tape drives in parallel, it runs the catalog job in parallel with the last client job, which is completely useless. I want to put on the end of the tape a backup of the catalog as at just after the client backups, so that in the case of a disaster I can restore that and I’ll be good to restore everything else.
    In addition to being completely useless for the purposes of putting an “after” catalog backup on the end of the tape, it’s also completely useless for the purposes of running a script last - I tried the following:
    include catalog {
    after backup optional "/usr/local/osb/pre-n-post after-catalog mail"
    This ran the pre-n-post script twice, once for each component of the catalog, which is altogether not what I want it to do.
    I can’t think of any way to achieve a catalog backup on the end of the script except for scheduling it for some time later and hoping the dataset backups always finish by then. Ugly.
    The only way I can think to achieve the run-a-script-last is to munge all the datasets together into one humongous dataset file, and do stuff as in the article to try to bend OSB to my will (again, hoping that OSB obeys the order of statements in the dataset). Which, when I’m given the ability to use “include dataset /Hosts” to make it easy to maintain, seems a bit of a mean trick to pull on me. And, again, with two tape drives available I’m not at all sure it’ll work in any case.
    I'll post further results as they come to light...
    David.

  • Storing values for object instances between runs

    I'm writing a simple 2d game and I'm trying to create an object to handle the information about individual tiles on the board.
    The tile class will handle three pieces of information:
    1. an image to represent the tile
    2. a boolean value (true if the tile can be passed through, false if it blocks movement)
    3. a name to describe the surface (mostly for management purposes - so I can say load("whiteMarble01") instead of using the full directory.)
    I plan to pre-build instances of these so that the tiles can be quickly placed with all their options pre-assigned.
    How would you store this data between runs of the game?
    My first thought was a folder (named whatever the name should be) containing an image file and a text file (which contains all the remaining values to be parsed). I don't think this is very good since the text file would only serve to store the boolean.
    Is there a better way?

    You can also use any of the standard XML APIs or java.beans classes XMLEndcoder and XMLDecoder:
    import java.beans.*;
    import java.io.*;
    import java.util.*;
    public class ExampleBean {
        private String name;
        private int code;
        public void setName(String name) {
            this.name = name;
        public String getName() {
            return name;
        public void setCode(int code) {
            this.code = code;
        public int getCode() {
            return code;
        public ExampleBean() {
        public ExampleBean(String name, int code) {
            setName(name);
            setCode(code);
        @Override public String toString() {
            return "(" + getName() + ", " + getCode() + ")";
        public static void main(String[] args) throws IOException {
            List<ExampleBean> beans = new ArrayList<ExampleBean>();
            beans.add(new ExampleBean("Homer", 40));
            beans.add(new ExampleBean("Marge", 37));
            File file = new File("temp.xml");
            XMLEncoder e = new XMLEncoder(
                new BufferedOutputStream(
                new FileOutputStream(file)));
            e.writeObject(beans);
            e.close();
            XMLDecoder d = new XMLDecoder(
                new BufferedInputStream(
                new FileInputStream(file)));
            System.out.println(d.readObject());
            d.close();
    }temp.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <java version="1.6.0" class="java.beans.XMLDecoder">
    <object class="java.util.ArrayList">
      <void method="add">
       <object class="ExampleBean">
        <void property="code">
         <int>40</int>
        </void>
        <void property="name">
         <string>Homer</string>
        </void>
       </object>
      </void>
      <void method="add">
       <object class="ExampleBean">
        <void property="code">
         <int>37</int>
        </void>
        <void property="name">
         <string>Marge</string>
        </void>
       </object>
      </void>
    </object>
    </java>

  • When the apple review team review our app,they point out that our  app uses a background mode but does not include functionality that requires that mode to run persistently.but in fact,when the app in background ,the app need data update to make the

    when the apple review team review our app,they point out that our  app uses a background mode but does not include functionality that requires that mode to run persistently。but in fact,when the app in background ,the app need data update to make the function of  trajectory replay come ture。in fact, we have added function when the app  is in background mode。we have point out the point to them by email。but they still have question on the background mode,we are confused,does anyone can help me,i still don't know why do review team can't find the data update when  the app is in background and how do i modify the app,or what is the really problem they refered,do i misunderstand them?
    the blow is the content of the review team email:
    We found that your app uses a background mode but does not include functionality that requires that mode to run persistently. This behavior is not in compliance with the App Store Review Guidelines.
    We noticed your app declares support for location in the UIBackgroundModes key in your Info.plist but does not include features that require persistent location.
    It would be appropriate to add features that require persistent use of real-time location updates while the app is in the background or remove the "location" setting from the UIBackgroundModes key. If your application does not require persistent, real-time location updates, we recommend using the significant-change location service or the region monitoring location service.
    For more information on these options, please see the "Starting the Significant-Change Location Service" and "Monitoring Shape-Based Regions" sections in the Location Awareness Programming Guide.
    If you choose to add features that use the Location Background Mode, please include the following battery use disclaimer in your Application Description:
    "Continued use of GPS running in the background can dramatically decrease battery life."
    Additionally, at your earliest opportunity, please review the following question/s and provide as detailed information as you can in response. The more information you can provide upfront, the sooner we can complete your review.
    We are unable to access the app in use in "http://www.wayding.com/waydingweb/article/12/139". Please provide us a valid demo video to show your app in use.
    For discrete code-level questions, you may wish to consult with Apple Developer Technical Support. When the DTS engineer follows up with you, please be ready to provide:
    - complete details of your rejection issue(s)
    - screenshots
    - steps to reproduce the issue(s)
    - symbolicated crash logs - if your issue results in a crash log
    If you have difficulty reproducing a reported issue, please try testing the workflow as described in <https://developer.apple.com/library/ios/qa/qa1764/>Technical Q&A QA1764: How to reproduce a crash or bug that only App Review or users are seeing.

    Unfortunately, these forums here are all user to user; you might try the developer forums or get in touch with the team that you are working with.

  • Hi, I have quick question about use of USEBEAN tag in SP2. When I specify a scope of SESSION for the java bean, it does not keep the values that I set for variable in the bean persistent.Thanks,Sonny

     

    Make sure that your bean is implementing the serializable interface and that
    you are accessing the bean from the session with the same name.
    Bryan
    "Sandeep Suri" <[email protected]> wrote in message
    news:[email protected]..
    Hi, I have quick question about use of USEBEAN tag in SP2. When I
    specify a scope of SESSION for the java bean, it does not keep the
    values that I set for variable in the bean persistent.Thanks,Sonny
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!

  • I want to create stored procedure which will give output rows from "values that are passed as one parameter (comma seperated) to store procedure".

    Hello,
    I want to create stored procedure which will give output rows from "values that are passed as one parameter (comma seperated) to store procedure".
    Suppose , 
    Parameter value : person 1,person2,person3 
    table structure : 
    Project Name | officers 1 | officers 2
    here, officers 1 or officers 2 may contain names of multiple people.
    expected OUTPUT : distinct list(rows) of projects where person 1 or person 2 or person 3 is either officer1 or officer 2. 
    please explain or provide solution in detail 
    - Thanks

    Hi Visakh,
    Thanks for reply.
    But the solution you provided giving me right output only if officer 1 or officer 2 contains single value , not with comma seperated value.
    Your solution is working fine for following scenario : 
    Project 
    Officers 1
    Officers 2
    p1
    of11
    off21
    p2
    of12
    off22
    with parameter : of11,off22 : it will give expected output
    And its not working in case of :
    Project 
    Officers 1
    Officers 2
    p1
    of11,of12
    off21,off23
    p2
    of12,of13
    off22,off24
    with parameter : of11,off22 : it will not give any row in output
    I need patten matching not exact match :) 
    ok
    if thats the case use this modified logic
    CREATE PROC GetProjectDetails
    @PersonList varchar(5000)
    AS
    SELECT p.*
    FROM ProjectTable p
    INNER JOIN dbo.ParseValues(@PersonList,',')f
    ON ',' + p.[officers 1] + ',' LIKE '%,' + f.val + ',%'
    OR ',' + p.[officers 2] + ',' LIKE '%,' + f.val + ',%'
    GO
    Keep in mind that what you've done is a wrong design approach
    You should not be storing multiples values like this as comma separated list in a single column. Learn about normalization . This is in violation of 1st Normal Form
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Web report - Variable values while switching between views.

    Hi Gurus,
    We have a query which has a few variables that are getting populated with default values during query execution[customer exits].
    We have added this query to the web.Now there is a date variable  which gets populated with the current date value by default.Suppose the users don't vant to run the report for the current date, they are able to change the date in the variable window and execute. But once the report is run, and we try to choose a different vieew for the report, the report automatically gets refreshed with the selected view, but for the default current date value (because of the customer exit).Shouldn't the selected view be getting refreshed with the date values that the user had entered while executing the report?
    Also when navigating between the different views, shouldn't a variable window pop up? Is there any setting to have the variable window pop up when navigating between the different views of a web report?
    Would appreciate a quick response.
    Thanks a Lot
    Arvind

    hello,
    we need to go to Query properties -> interaction tab-> remove reuse variables to populate the variable screen everytime or "Save and reuse variable values" to supress variable window
    or
    Problem could be due to any personalisation.try this:
    One the query is executed, click on the button which says change variable values.
    In the variable pop-up screen which comes up click on the personalization button
    In the new screen which comes up click on reset personalization button
    Enter new variable values and execute the query.
    Reg,
    Dhanya

  • When pasted large # of values in Choice Prompt,  Stop running this script?

    Hi,
    In a choice prompt, I am cut paste large number of values (about 4000) in 11g dashboard. After a few seconds I get a popup 'Stop running this script?'. The same number of values works very quickly and without prompt in 10g.
    The behavior looks to be due to java script running to set the choice values in 11g. Even if I paste these as ; separated values time taken is very very large.
    Two questions
    (a) Why it takes so long compared to 10 g? If I paste small # of values (say 30) , control comes back with active 'Apply' button quickly.
    (b) What can be done to improve this performance?
    See this posting http://www.itwriting.com/blog/119-ie7-script-madness.html and work around to suppress the popup.
    I tried using presentation variable and that avoids the popup. Why?
    I will like to know what options I have for better user experience.
    Bhupendra

    You need to use Column Filter Prompt for this. One of the main reasons why this is not available in a Dashboard Prompt is that in a Dashboard Page you can have reports using the dashboard prompts and standalone reports(that do not use dashboard prompts). Since there is no link between the dashboard prompts and the individual reports per se, you would not be able to run the reports(that depend on the dashboard prompts) after entering the data in the dashboard prompt. The first way as i said is to use Column filter prompts instead of Dashboard Prompts. The other way to achieve this is, create the dashboard prompt and the report in seperate sections. Then minimize the report section. So, first time you open the dashboard the report would not run in the background. Expand when you actually want to see the report. The third way is to use presentation variables rather than using the is prompted clause. The fourth way is by specifying some default values(which i believe you do not want).
    Thanks,
    Venkat
    http://oraclebizint.wordpress.com

  • Issue with a stored procedure that uses a sys refcursor to output dataset..

    Hi All:
    I create a stored procedure that uses an in out sys ref cursor:
    create or replace procedure FIRE_SALES_100_CALLS_REPORT
    ( p_cursor in out sys_refcursor)
    IS
    BEGIN
    --Insert into the temp table the records for the rep sales
    EXECUTE IMMEDIATE '
    INSERT INTO TMP_SALES_CNT_BY_USER
    TOTALPRODUCTSSOLD,
    NUMBEROFCALLS,
    SALESPER100CALLS,
    SERVICEORDERNUM,
    PRODUCT,
    LOGIN,
    FST_NAME,
    LAST_NAME,
    NAME,
    POSITIONHELD,
    CURRENTPARPARTYID,
    QUERY_DATE,
    CREATED_BY
    SELECT e.TotalProductsSold,
    e.NumberOfCalls,
    ((e.TotalProductsSold/e.NumberOfCalls)*100) AS SalesPer100Calls,
    e.ServiceOrderNum,
    e.Product,
    e.login,
    e.fst_name,
    e.last_name,
    e.name,
    e.PositionHeld,
    e.CurrentParPartyID,
    e.query_date,
    e.created_by
    FROM (
    SELECT COUNT(o.order_num) over ( partition by u.login
    order by u.login) AS TotalProductsSold,
    SUM(NVL(x.n_inbound,1) + NVL(x.n_outbound,1)) over (partition by u.login
    order by u.login) AS NumberOfCalls,
    o.order_num AS ServiceOrderNum,
    pi.name as Product,
    u.login,
    c.fst_name,
    c.last_name,
    postn.name,
    c.pr_held_postn_id as PositionHeld,
    p.par_party_id as CurrentParPartyID,
    NVL(x.query_date,NVL(o.last_upd, null)) AS query_date,
    o.created_by
    FROM firestg.SEB_S_order o
    INNER join firestg.seb_s_order_item oi ON o.row_id = oi.order_id
    INNER join firestg.seb_s_prod_int pi ON oi.prod_id = pi.row_id
    INNER join firestg.SEB_s_contact c on c.Row_Id = o.created_by
    INNER join firestg.SEB_s_user u on u.row_id = o.created_By
    INNER join firestg.SEB_s_party p on p.row_id = c.pr_held_postn_id
    INNER join firestg.SEB_s_postn postn on postn.row_id = c.pr_held_postn_id
    LEFT OUTER JOIN (
    SELECT taw.QUERY_DATE,
    vaw.n_inbound,
    vaw.n_outbound,
    oaw.object_name, oaw.object_id
    FROM GEN_T_AGENT_WEEK taw
    INNER JOIN GEN_V_AGENT_WEEK vaw ON taw.time_key = vaw.time_key
    INNER JOIN GEN_O_AGENT_WEEK oaw ON oaw.object_id = vaw.object_id) x
    ON u.cti_acd_userid = x.object_name
    WHERE NVL(x.query_date,NVL(o.last_upd, null)) BETWEEN (TRUNC (next_day (sysdate, ''SUN''))-14)
    AND (TRUNC (next_day (sysdate, ''SUN''))-8)
    AND o.status_cd IN (''Complete''))e';
    --Lookup the first level to see if there is a higher level person
    EXECUTE IMMEDIATE '
    UPDATE TMP_SALES_CNT_BY_USER a
    SET (ParPartyID_1ST, LOGIN_1ST,FST_NAME_1ST,LST_NAME_1ST,TITLE_1ST) =
    (SELECT pa.par_party_id,
    U.Login,
    C.FST_NAME,
    C.Last_Name,
    p.name
    FROM firestg.seb_s_postn p
    inner join firestg.seb_s_user U on u.Row_Id = p.pr_emp_id
    inner join firestg.seb_s_contact c on c.Row_Id = p.pr_emp_id
    INNER join firestg.SEB_s_party pa on pa.row_id = c.pr_held_postn_id
    WHERE p.row_id = a.currentparpartyid)
    WHERE CurrentParPartyID IS NOT NULL';
    --Lookup the second level to see if there is a higher level person
    EXECUTE IMMEDIATE '
    UPDATE TMP_SALES_CNT_BY_USER a
    SET (ParPartyID_2ND, LOGIN_2ND,FST_NAME_2ND,LST_NAME_2ND,TITLE_2ND) =
    (SELECT pa.par_party_id,
    U.Login,
    C.FST_NAME,
    C.Last_Name,
    p.name
    FROM firestg.seb_s_postn p
    inner join firestg.seb_s_user U on u.Row_Id = p.pr_emp_id
    inner join firestg.seb_s_contact c on c.Row_Id = p.pr_emp_id
    INNER join firestg.SEB_s_party pa on pa.row_id = c.pr_held_postn_id
    WHERE p.row_id = a.ParPartyID_1ST)
    WHERE a.ParPartyID_1ST IS NOT NULL';
    --Lookup the third level to see if there is a higher level person
    EXECUTE IMMEDIATE '
    UPDATE TMP_SALES_CNT_BY_USER a
    SET (ParPartyID_3RD, LOGIN_3RD,FST_NAME_3RD,LST_NAME_3RD,TITLE_3RD) =
    (SELECT pa.par_party_id,
    U.Login,
    C.FST_NAME,
    C.Last_Name,
    p.name
    FROM firestg.seb_s_postn p
    inner join firestg.seb_s_user U on u.Row_Id = p.pr_emp_id
    inner join firestg.seb_s_contact c on c.Row_Id = p.pr_emp_id
    INNER join firestg.SEB_s_party pa on pa.row_id = c.pr_held_postn_id
    WHERE p.row_id = a.ParPartyID_2ND)
    WHERE a.ParPartyID_2ND IS NOT NULL';
    --Lookup the fourth level to see if there is a higher level person
    EXECUTE IMMEDIATE '
    UPDATE TMP_SALES_CNT_BY_USER a
    SET (ParPartyID_4TH, LOGIN_4TH,FST_NAME_4TH,LST_NAME_4TH,TITLE_4TH) =
    (SELECT pa.par_party_id,
    U.Login,
    C.FST_NAME,
    C.Last_Name,
    p.name
    FROM firestg.seb_s_postn p
    inner join firestg.seb_s_user U on u.Row_Id = p.pr_emp_id
    inner join firestg.seb_s_contact c on c.Row_Id = p.pr_emp_id
    INNER join firestg.SEB_s_party pa on pa.row_id = c.pr_held_postn_id
    WHERE p.row_id = a.ParPartyID_3RD)
    WHERE a.ParPartyID_3RD IS NOT NULL';
    --Lookup the fifth level to see if there is a higher level person
    EXECUTE IMMEDIATE '
    UPDATE TMP_SALES_CNT_BY_USER a
    SET (ParPartyID_5TH, LOGIN_5TH,FST_NAME_5TH,LST_NAME_5TH,TITLE_5TH) =
    (SELECT pa.par_party_id,
    U.Login,
    C.FST_NAME,
    C.Last_Name,
    p.name
    FROM firestg.seb_s_postn p
    inner join firestg.seb_s_user U on u.Row_Id = p.pr_emp_id
    inner join firestg.seb_s_contact c on c.Row_Id = p.pr_emp_id
    INNER join firestg.SEB_s_party pa on pa.row_id = c.pr_held_postn_id
    WHERE p.row_id = a.ParPartyID_4TH)
    WHERE a.ParPartyID_4TH IS NOT NULL';
    -- If there was no 1st place then the rep is a VP
    EXECUTE IMMEDIATE '
    UPDATE TMP_SALES_CNT_BY_USER a
    SET a.vp = a.last_name || '', '' || a.fst_name,
    a.vp_login = a.login
    WHERE a.login_1st IS NULL';
    --If there is no second place then the rep has a VP and is a Director
    EXECUTE IMMEDIATE '
    UPDATE TMP_SALES_CNT_BY_USER a
    SET a.vp = a.lst_name_1st || '', '' || a.fst_name_1st,
    a.vp_login = a.login_1st,
    a.director = a.last_name || '', '' || a.fst_name,
    a.director_login = a.login
    WHERE a.login_1st IS NOT NULL
    AND a.login_2ND IS NULL';
    --IF there is no third place then the rep has a VP, Director & is a Manager
    EXECUTE IMMEDIATE '
    UPDATE TMP_SALES_CNT_BY_USER a
    SET a.vp = a.lst_name_2ND || '', '' || a.fst_name_2ND,
    a.vp_login = a.login_2ND,
    a.director = a.lst_name_1st || '', '' || a.fst_name_1st,
    a.director_login = a.login_1st,
    a.manager = a.last_name || '', '' || a.fst_name,
    a.manager_login = a.login
    WHERE a.login_1st IS NOT NULL
    AND a.login_2ND IS NOT NULL
    AND a.login_3rd IS NULL';
    --If there is no fourth place then the rep has a VP, Dir, Manager, and is a Supervisor
    EXECUTE IMMEDIATE '
    UPDATE TMP_SALES_CNT_BY_USER a
    SET a.vp = a.lst_name_3RD || '', '' || a.fst_name_3RD,
    a.vp_login = a.login_3RD,
    a.director = a.lst_name_2ND || '', '' || a.fst_name_2ND,
    a.director_login = a.login_2ND,
    a.manager = a.lst_name_1st || '', '' || a.fst_name_1st,
    a.manager_login = a.login_1st,
    a.supervisor = a.last_name || '', '' || a.fst_name,
    a.supervisor_login = a.login
    WHERE a.login_1st IS NOT NULL
    AND a.login_2ND IS NOT NULL
    AND a.login_3rd IS NOT NULL
    AND a.login_4th IS NULL';
    --If there is no fifth plance then the rep has a VP, Dir, Mgr, Supervisor, and is a Team Lead
    EXECUTE IMMEDIATE '
    UPDATE TMP_SALES_CNT_BY_USER a
    SET a.vp = a.lst_name_4TH || '', '' || a.fst_name_4TH,
    a.vp_login = a.login_4TH,
    a.director = a.lst_name_3RD || '', '' || a.fst_name_3RD,
    a.director_login = a.login_3RD,
    a.manager = a.lst_name_2ND || '', '' || a.fst_name_2ND,
    a.manager_login = a.login_2ND,
    a.supervisor = a.lst_name_1st || '', '' || a.fst_name_1st,
    a.supervisor_login = a.login_1st,
    a.teamlead = a.last_name || '', '' || a.fst_name,
    a.teamlead_login = a.login
    WHERE a.login_1st IS NOT NULL
    AND a.login_2ND IS NOT NULL
    AND a.login_3rd IS NOT NULL
    AND a.login_4th IS NOT NULL
    AND a.login_5th IS NULL';
    --If there is a fifth place then the rep has a VP, Dir, Mgr, Supervisor, Team Lead and is a rep
    EXECUTE IMMEDIATE '
    UPDATE TMP_SALES_CNT_BY_USER a
    SET a.vp = a.lst_name_5TH || '', '' || a.fst_name_5TH,
    a.vp_login = a.login_5TH,
    a.director = a.lst_name_4TH || '', '' || a.fst_name_4TH,
    a.director_login = a.login_4TH,
    a.manager = a.lst_name_3RD || '', '' || a.fst_name_3RD,
    a.manager_login = a.login_3RD,
    a.supervisor = a.lst_name_2ND || '', '' || a.fst_name_2ND,
    a.supervisor_login = a.login_2ND,
    a.teamlead = a.lst_name_1st || '', '' || a.fst_name_1st,
    a.teamlead_login = a.login_1st
    WHERE a.login_1st IS NOT NULL
    AND a.login_2ND IS NOT NULL
    AND a.login_3rd IS NOT NULL
    AND a.login_4th IS NOT NULL
    AND a.login_5th IS NOT NULL';
    open p_cursor for
    SELECT tsc.vp,
    tsc.director,
    tsc.manager,
    tsc.supervisor,
    tsc.teamlead,
    (tsc.last_name || ', ' || tsc.fst_name) AS Rep,
    tsc.product,
    tsc.totalproductssold,
    tsc.numberofcalls,
    tsc.salesper100calls
    FROM TMP_SALES_CNT_BY_USER tsc;
    END FIRE_SALES_100_CALLS_REPORT;
    The table I use is a Global temp table.
    This runs just fine in oracle but when I try to build a data foundation in Business Objects I get the error that says you cannot insert/update/delete in a READ ONLY Transaction.
    I really need some advice on what to do since I really dont have access to a scheduled script and table that would store my data ahead of time.

    Well, AFAIK, BO is a reporting tool, so it si read-only by nature. I do not know if it possible to "tell" BO table is GTT and it is OK to write to it. You need to post this in BO forum.
    SY.

  • Retaining values when navigating between subtabs

    Hello everyone
    I have a subtab region with 3 tabs in my page. I have some form fields in each tab, when I enter some details in tab1 and click tab2, and then come back to tab1 , my details previously entered in tab1 gets cleared. is there a way to retain these values when navigating between subtabs. all the tabs are based on different VO's
    Thanks
    Ravi

    Here's how I do it...
    (1) I always use Sessions.  In the main form of my application, I set up the session and I store a single variable:  Session.Exists = True.  All other forms begin something like this:  (It's actually an include-file.)
    <cflock ...>
    <cfset SessionExists = StructKeyExists(Session, "Exists")>
    </cflock>
    <cfif NOT SessionExists>
       <cflocation ... send 'em back to the home 'cuz their session has expired>
       <cfabort>
    </cfif>
    (2) Now that we know that a session exists, we store various structs in the Session to contain the default or current values that have been used in a particular form.  If the Session scope does not contain a particular struct, it is automagically created with appropriate default values.)  This becomes "what we display," and when we capture the user's responses, we store them there, even before we validate them.  The session pool therefore becomes the vehicle for communication between the various forms.
    (3) If we reach a point where a particular piece of information is no longer useful, we delete the appropriate structure from the Session, thereby wiping out the entire set of values at once.
    (4) Structs and Arrays can, of course, contain other Structs and Arrays.  You can build data structures of arbitrary complexity.
    (5) As of late, I have found myself specifying individual CFCs for each logical "object" in my application.  This is true object-oriented programming, as best as ordinary CFC techniques can do without plunging headlong into the underlying nether-world of Java.  In those CFCs, I deliberately try to conceal just how information is maintained and stored, so that these necessary inter-dependencies within my application are concentrated in just one place.  "The structure is 'the object,' and the methods are found 'here and only here.' "

  • More trouble with timezones when storing value in TS WITH LTZ

    Using Oracle 9i, JDK 1.4.2.
    I have a script using the Jakarta Jelly framework to initialize my db. When I run the script, I want to set the current time in several "TIMESTAMP WITH LOCAL TIME ZONE" columns.
    Before the time change, the following excerpt from my script was working fine.
    <j:new className="java.util.Date" var="now" />
    <j:new className="java.text.SimpleDateFormat" var="format">
    <j:arg type="java.lang.String" value="dd-MMM-yyyy hh.mm.ss.SS a Z"/>
    </j:new>
    <j:set var="ts"
    value="cast(cast('${format.format(now)}' as timestamp with time zone) as timestamp with local time zone)"/>
    The "Z" in the date/time format produces a 3-letter timezone abbreviation, like "PST" or "PDT".
    Before the time change, I was getting "PST" from this, and the code was working fine. When the time change hit, I discovered that Oracle doesn't grok "PDT" (I found info on the internet about this, but I can't find it right now). I thought for a short time on this, and I changed "Z" to "z", which results in "-0700" instead of "PDT". This appeared to work fine. It didn't fail, at least.
    However, what I discovered today is that Oracle gets confused by it. It recognizes that as a timezone offset, but it only "half" understands this. When I view the value in SQLDeveloper, it shows a time value 7 hours before the current time, instead of the correct current time as it used to.
    I also tried hardcoding a date string, using "US/Pacific", and Oracle groks that, but of course, it doesn't know to use daylight savings time.

    that makes sense because you are setting the sessionAttribute at the wrong time.. see you are passing the paramater from index to shop, so you really need to set the sessionAttribute in the index page so it is always available in the shop page.
    hope that helps...you will always have this problem when refreshing because when you refresh the value from "customer" is not being passed again.....

  • Help with at start up folder that  flashes between ? and Mac OS Icon.

    So I have an eMac that had Mac OS X 10.3.5 on it. About a week ago a software update came over on my Mac for 10.3.9. I tryed to download it and upgrade my OS. Somewhere along the line something crashed and I tryed to revert back to my 10.3.5 after that I turned off my Mac and turned it on again and I got the darwin screen. Now I dont have the original OS disk that came with this Mac, I got it off a friend of the family. I did have a Power Mac G5 OS X 10.4 CD that I was able to get into the CD by holding down C when started up. the Disk First Aid said everything was fine, and I tryed to install that and it told me that I could not install this software on my Mac. So someone I work with told me to erase the drive in the First Aid menu and the computer will reboot the OS. So I Erased the hard drive and went into the menu that lets you choose the start up OS and that did not load. Now when I turned on my eMac it just goes to a screen with a folder that blinks back and forth between a question mark and a Mac OS Icon.
    Another person I work with has a Mac OS X 10.3 CD and said that should get everything up and running again , but he has not found it yet. Last night I tryed my parents iMac OS 10.2 CD and that CD will not load when I hold down C when I start the Mac.
    Any Ideas?
    Thanks

    cosmichobo wrote:
    They have a version of the Mac OS that will "only" run on that particular computer.
    More accurately, this should read "...that will "only" run on that particular computer model." Those disks are always gray in color.
    Generally, a Mac will not accept/run an OS version lower than the one it shipped with.
    The Hobo is exactly on target when he asked for the specific model. There are two distinct generations of eMacs and that can affect recommendations. We can better help you if we know which one.
    I'm a little confused about the disks. Did any of the disks you're tried or will be borrowing come from an eMac? Did your eMac come with 10.3 pre-installed or did you upgrade from an older version of OSX?
    It's a little late in your case, but I have a way of dealing with Software Updates (SU) that's never (knock wood) killed any of our 13 Macs: When a system update is first offered, I don't let SU install it then. I finish what I was doing, closing all active applications, then use Disk Utility on my hard drive to Repair Permissions (RP) BEFORE I allow SU to install anything. Then I run it again AFTER SU finished. Permission repair is controversial but harmless, but I'm doing something right that has kept me from having update problems, so I keep doing RP before installing any updates that SU pushes out.

  • Saved default Parameter values not appearing in Run Time version of report

    I've created a report in Crystal 2008 and set up a number of parameters. I supplied each of them with a default value. I check it out in Crystal Reports and a nice looking window opens up that shows all my parameters with the default values. I save the report and open it within our application and upon pressing print, a plain looking box appears that lists my parameters but none of the saved values are included. Is this a problem with my version of Crystal Reports (ver. 12.2.0.290) that I can get an update for to fix; Or, is this a problem with the crviewer.dll that we are running in our application (ver 11.0.0.1282, dated March 8, 2005)?
    I'm worried about updating to the latest Crystal 2008 crviewer.dll because I've read where it is only for reports with Saved Data and that won't work for us. We need the ability to refresh the data on the reports.

    Hi Mike,
    It likely is the viewer causing the problem. 2008 now has cascading parameters and the activex viewer does not support them.
    All I can suggest is you try CR XI R2 which you can upgrade for free, you have to contact CIC to get a keycode to deploy your app, and test again.
    R2 is out of support now so no fixes available...
    http://downloads.businessobjects.com/akdlm/crystalreports/crxir2_sp4_full_bld_0-20008684.exe
    http://downloads.businessobjects.com/akdlm/crystalreports/CRYSTALREPORTS06_0-20008684.EXE
    Thanks
    Don

  • Can I create a Stored Procedure That access data from tables of another servers?

    I'm developing a procedure and within it I'm trying to access another server and make a select into a table that belongs to this another server. When I compile this procedure I have this error message: " PLS-00904: insufficient privilege to access object BC.CADPAP", where BC.CADPAP is the problematic table.
    How can I use more than one connection into an Oracle Stored Procedure?
    How I can access tables of a server from a Stored Procedure since the moment I'm already connected with another server?
    Can I create a Stored Procedure That access data from tables of another servers?

    You need to have a Database Link between two servers. Then you could do execute that statement without any problem. Try to create a database link with the help of
    CREATE DATABASE LINK command. Refer Document for further details

Maybe you are looking for

  • Unable to Connect to database server

    Hi All, I have installed Oracle 11g R2 database, I used it for almost a month now and then today when I tried to log in into it I am getting this error. An error was encountered performing the requested operation: Listener refused the connection with

  • Purchase Order segment field is enabled even though Split Purchase Order option is disabled

    Hi, In Purchase Order top right side, next to Document Number field, there is a Segment field. My understanding was that it comes only if Split Purchase Order setting is enabled in Per Document Settings. But in my Per Document Settings for PO, the Sp

  • Envy 17-j050ex is it quad core or dual core

    Hello, the HP envy-j050ex. in the specs page of the link below mentioned that it's processor is dual core. http://www8.hp.com/sa/en/products/laptops/product-detail.html?oid=5399952#!tab=specs and @ intel website they said that the processor intel-cor

  • No sound when playing youtube videos

    I have run the troublshoot and checked for upgrades for my sound driver and I still have no sound when playing a youtube video. I can listen to radio over the internet fine. My laptop started doing this about 2 months ago when I was trying to finish

  • Dont Record message Unity 8.5

    Good Afternoon I have a CUCM 8.6 in cluster, integrated with unity conection 8.5 in cluster-pair, An caller call to an user register in unity,  unavailable greeting is enabled for the user caller, but never recorded, the voice port are correct.