# determine if user is doing a previewmy $outputFileName = iwpt_get_ofile_name("basename");my $isPreviewMode = ($outputFileName =~ m/^zz_tst_/);if (!$isPreviewMode) { ...}
Could you elaborate on your second item a little more. I understand when you say that users do not edit the DCR like we do here but you lose me after that.
Yes, I knew that. That is the way I determine if the user is previewing or generating in my tpl file to take different actions.
I worked on the FormAPI today generating the file for me. That worked great if I was filling out a new DCR or editing an existing one. However, it does not appear to run the script code I wrote if the user simply opens the DCR (not in edit mode) and clicks the generate button (never saw my alert and the select an output file dialog popped). Here is my code:
So...heh...is there any way that I can turn off the generate button if they are simply viewing the DCR and not editing it (e.g., clicked the DCR file name link rather than the edit link associated with it)? I think I already know the answer because the only way I know to turn off generate is with viewoptions in templating.cfg which turns it off in both modes.
Scenario is that after filling out a form, the user attempts to generate the file using my presentation template. I already know where I want the file saved and what the file name needs to be. I attempted to use iw_ostream but it is still prompting the user for a file name.The goal is that since I know where and what file name I want to avoid the user putting it in the wrong place with the worng name.