Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I need to create a condition in the script;
If the result was true, load data from database
Else, keep the current data in the document.
The script could be like the following:
If <CONDITION> then
Load … from ...
Else
// keep current data in the document
End if
Could you help me please to create this script?
Regards,
Yacine
I found the solution.
I added "Binary <the current document path>" in the top of the script
That's all
I found the solution.
I added "Binary <the current document path>" in the top of the script
That's all
But this has nothing to do with your first query?
Your approach to the script is correct, as conditions you may hardcode a certain age of the file to read, or number of records. You may also store the filetime of the last load into a variable and then do the comparison to find out, whether the current file is newer.
The ELSE-condition may also contain an EXIT SCRIPT - thus no refresh.
Your code then may look like
LET sFile = 'YourFile';
IF dLastFileDate < FILETIME($(sFile)) THEN
LOAD * FROM $(sFile);
ELSE
EXIT SCRIPT;
END IF;
LET dLastFileDate = FILETIME($(sFile));
HTH
Peter