Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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
Have you tried with 'Partial Reload'?
Yes, I did. I did try. but, it doesn't work mate..
Thanks.
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
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.
HI,
In that case please share your app or Script, it will be easy for us to identify the issue
// 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.
Thank very much indeed.