6 Replies Latest reply: Feb 21, 2017 12:14 PM by Natthapol K RSS

    Anyone knows how to run script without reloading document?

    Natthapol K

      Hi,

       

      I wanna run script like startup script used for setting initial parameter such as version no., pre-defined parameters, and so on. What Im doing now is to reload document to invoke the my intended script. Unfortunately, my recently existing temp tables have been gone every time I open document because there is trigger to reload document (I have already set condition which is NOT allowed to load data again) so that I wanna only execute the script to set up initial parameters. I don't wanna load data full data coz I take much time when starting up document.

       

      Thanks.

        • Re: Anyone knows how to run script without reloading document?
          Settu Periyasamy

          Have you tried with 'Partial Reload'?

          • Re: Anyone knows how to run script without reloading document?
            sasi k

            HI,

            Try some thing like below

            ***********************************************

            IF isPartialLoad() THEN

             

            //Your Script to use initial parameters

             

            END IF

             

            //Noramal tables

            **********************************************

             

            Then do a Partial Reload so that only your script will be executed

              • Re: Anyone knows how to run script without reloading document?
                Natthapol K

                Oh, well. let me try then get back the result. The thing is my data in the temp table have always gone when getting the Reloading document.

                 

                Thank you for your helping.

                  • Re: Anyone knows how to run script without reloading document?
                    sasi k

                    HI,

                    In that case please share your app or Script, it will be easy for us to identify the issue

                      • Re: Anyone knows how to run script without reloading document?
                        Natthapol K

                        // Loading variable when starting application up ONLY.

                        If vStartLoadingVariables =  1 AND  IsPartialReload() Then // 1 = True  (enable Generator function)

                          $(Include=helper\LoadVariables.qvs);   <<<<<< Load variables

                            CALL Log("Loaded configuration variables");

                            vStartLoadingVariables = 0; // disable loading next time (allow loading just when only openning document )

                        ENDIF

                         

                        Then

                        --------------------------------------

                        LoadVariables.qvs

                        --------------------------------------

                        $(Include=helper\qvc.qvs);

                        LET LET_VARIABLES = -1;

                        LET SET_VARIABLES = 0;

                        ///////////////////////////////////////////////////////////////

                        // Load variables are doing the following

                        // 1. Loading variables from MS Excel with column name (VarName,Value) into the temp table named Variables.

                        // 2. Creating the internal variable.

                        // 3. Dropping the temp table named Variables.

                        ///////////////////////////////////////////////////////////////

                        TRACE *******************************;

                        TRACE *** Start loading configuration variables ***;

                        TRACE *******************************;

                        Variables:

                        LOAD

                            VarName,

                            Value

                        FROM [.\Configuration\ConfigurationVariables.xls]

                        (biff, embedded labels, table is [AppConfiguration$]);

                         

                        CALL Qvc.PopulateVariables ('Variables', LET_VARIABLES);

                         

                          If (len(TableNumber('Variables')) > 0) Then

                          DROP Table Variables;

                          TRACE *** Completely DROP Table Variables ***;

                          End If

                        TRACE **********************************;

                        TRACE *** Finished loading configuration variables ***;

                        TRACE **********************************;

                         

                        What I am in doubt is the reason why the Variables table doesn't exist in the mean time it's executing. Even though, this script always creates this table. Because of none of this table, that's why it displays this error screen below.

                         

                        N.B. :

                        1. This part of code occurred error is in the $(Include=helper\qvc.qvs) file. You are able to ignore this code.

                        2. Instead of full reload data making all tables gone, the isPartialLoad() function you told helps me solve the issue about data lost. Unfortunately, there is this kind of error screen.

                        22-02-2017 0-00-21 AM.png

                         

                        Thank very much indeed.