Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
You can set a action on a field at the triggers in documents settings for example by selecting.
When the field is lost after executing script by an error, the action is lost, too.
Is there a way to set the actions in the script?
Regards
Hi,
I created an idea
http://community.qlik.com/ideas/2687
It's still "awaiting review", then it's not possible to vote for it yet...
Interesting workaround
Regards,
Erich
Great - thanks for letting me know. I have bookmarked it and will vote when it is approved. Thanks.
My personnal solution to manage this problem and having no data lost is :
// True if in dev mode ; flase other
LET vDebug_AutoSave=True();
// SUB for copy file to another one
SUB FILE_COPY (Src,Dest)
trace 'FILE_COPY "$(Src)" "$(Dest)"' ;
EXECUTE cmd.exe /C C: && COPY /Y "$(Src)" "$(Dest)";
ENDSUB
// first line of active code in the main is :
// if can find my version with data + just before any error on the file in date & documentName format
IF (vDebug_AutoSave=True()) then
CALL FILE_COPY (DocumentName(),Timestamp(Now(),' YYYYDDMMhhmmsss')&DocumentName());
ENDIF
Your script seems to duplicate the native functionality available in Settings, User Preferences, Save. Specifically, "Save before reload" and "Use backup instances".
Is there some advantage to the script snippet you posted?
-Rob
Y ou're right Rob.
I was not aware of this setting.
(as all ingeneers,i have not read the manual )
I will try your suggestion.
Thanks.
Hi Martin.
I am stumbeling upon the same problem at one of my clients, and I am using -prj-folders to hold document definitions.
And they use Git for version control.
The problem arises when we want to use Git to deploy apps.
When docs are recreated using -prj-folders, they get recreated W/O data - that is, no data model and thus no fields.
And NO field event triggers, which are vital for almost all apps I've ever seen, in one way or another.
Anyway, I opened a ticket on QT support right about now.
So maybe it will come in QV 11.2 SR6 😃
Kind regards
BI Architect Consultant
Hi,
I'm facing the same situation when using SVN for transporting the PRJ folder from one machine to another. As this is my company's approach to move a QVW to production, I somehow need to fix this.
Is there a way to store field event triggers to a macro / load script etc. in the meanwhile? I tried to run the script from flipside above, but it does not do anything in my QVW file.
Thanks.
Anyone?
No solution, but the idea mentioned above in this thread is now live, so for a long term, non "work around" solution - go and vote
http://community.qlik.com/ideas/2687
Thanks
Hi Magnus,
We had the same problem when pulling a qvw out of Source Control. A good workaround is to create a script (with Powershell or something similar) that scans through the AllProperties.xml file (in the -prj folder) for the fields that you want to have triggers, and replaces the <OnSelectAction></OnSelectAction> node with one containing the correct syntax for the trigger you're after. For example, if I wanted to add a trigger to run a macro called 'MyMacro', it would look like the following:
<OnSelectActionItems>
<ActionItemDef>
<Type>TYPE_MACRO</Type>
<Parameters>
<StringExpr>
<v>MyMacro</v>
</StringExpr>
</Parameters>
<StateName></StateName>
</ActionItemDef>
</OnSelectActionItems>
For other types of triggers, the best way to get the xml syntax correct is to recreate the trigger manually in the desktop client, save and exit, then search the xml file for the given field and make a note of how it is displayed.
My script contains a hashtable that pairs each Field name with the required xml that I need to insert. If you keep this updated every time you add a trigger, it should be easy to run and 'repair' your 'AllProperties.xml' if the triggers ever drop in future. Once the xml has had the triggers re-applied, you should find them there next time you open the qvw.
Hope this helps.
-James