Focal Point
[CLOSED] Conditional AutoPrompt

This topic can be found at:
http://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/9197031196

February 25, 2019, 01:00 PM
vaayu
[CLOSED] Conditional AutoPrompt
I have searched on this topic and found very little info. Trying to see if we can conditionally "Prompt the user" or "Run with Defaults" I tried this link and wasn't successful
http://forums.informationbuild...957043096#6957043096

This is the simplest requirement that I have. Please advise.

  
-DEFAULTH &FLG='Y';
-IF &FLG EQ 'N' THEN GOTO SKIP_IT;
-DEFAULT &PARM1=’VALUE1’;
-TYPE PROMPT for parms here
-SKIP_IT
-TYPE run with defaults here
-DEFAULTH &PARM1 = ‘VALUE2’;

This message has been edited. Last edited by: FP Mod Chuck,


-********************
Sandbox: 8205
Dev: 8201M
Prod:8009
-********************
February 25, 2019, 01:21 PM
BabakNYC
What's the condition that'll determine your decision?


WebFOCUS 8206, Unix, Windows
February 25, 2019, 01:32 PM
vaayu
I believe our user wants to use the same procedure as Adhoc versus scheduled job Via ReportCaster. When its scheduled we need it to run with defaults and when we launch it adhoc, we expect to pass some parms.
Thanks in advance.

This message has been edited. Last edited by: vaayu,
February 25, 2019, 01:45 PM
BabakNYC
You should probably try -DEFAULT instead of -DEFAULTH.


WebFOCUS 8206, Unix, Windows
February 25, 2019, 10:22 PM
vaayu
BabakNYC,
The requirement is to enable/disable prompt based on a flag so thats why I have a DEFAULT in one place and DEFAULTH in another place. We want to control the prompting based on a flag. Hope it makes sense


-********************
Sandbox: 8205
Dev: 8201M
Prod:8009
-********************
February 26, 2019, 03:58 AM
Wep5622
Your problem is with autoprompt. It isn't smart enough to follow conditional expressions.

In this case, it sees the -DEFAULT before it sees the -DEFAULTH, so it prompts for a value.

That suggests that you could invert your condition, putting the -DEFAULTH inside it and skipping to the -DEFAULT otherwises, but that won't work either; autoprompt will then see -DEFAULTH before -DEFAULT and never prompt.

What would work is to put both conditional sides into a separate file each and include the remainder of your procedure after that. Then, in the case that the user runs the truth-side procedure, she gets a prompt, and if she runs the falsehood-side procedure, she won't.

-* report_prompted.fex
-DEFAULT &PARM1 = 'VALUE1';
-INCLUDE report.fex


-* report_unprompted.fex
-DEFAULTH &PARM1 = 'VALUE1';
-INCLUDE report.fex



WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :