Focal Point
[CLOSED] Default Parameters - Variables & Constants

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/5097041196/m/8417044196

July 25, 2019, 10:35 AM
ryanj
[CLOSED] Default Parameters - Variables & Constants
Is it possible to have a default parameter value be a variable?

Example being that when the designer is run, the parameter for date field will default to today's date?

There is a section for default parameter in the designer but looks like it would have to be set to a constant.

Any insight would be appreciated!

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


8.2.02M
July 26, 2019, 12:01 PM
FP Mod Chuck
Ryan

Can you provide a little more detail. Are you creating a workbook, chart, page or portal in the designer. Are you refrencing a fex that has a WHERE on the date?


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
July 29, 2019, 08:32 AM
ryanj
Building a page, there is a WHERE in the fex that is an optional multiselect parameter. So the default date value is ALL but would like it to always reference the current day.


8.2.02M
July 31, 2019, 12:50 PM
FP Mod Chuck
Ryanj

I have asked product management to look at this and they will be providing some guidance.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
August 20, 2019, 06:48 PM
Michele Brady
Hi Ryanj,

You are correct that Page Designer filters do not take amper variables as filter values, since behavior is the same as autoprompt. If you do not set a default value or try to use an amper variable as the –DEFAULT, and the filter uses a FROM… TO relationship, the default in the control will be the current date. If the filter uses another relationship, such as EQ, GE, or LE, then the resulting control is a drop-down list, and the default is the first value in the list.
When a procedure creates a drop-down control in autoprompt and Page Designer, you can use a global variable to set the default, which is included in this topic: https://kb.informationbuilders...rols-8205-and-higher There is also a video that you can use as reference, https://webfocusinfocenter.inf...nalized_Defaults.mp4.
In addition, I’m including a simplified example that reflects what you are trying to do below. If you have any questions or would like to connect, just let us know.

The first step is to set up a very simple FOCEXEC to set the global variable. For example, you can use the following to set the global variable to be the current date:
-SET &&TIME_DATE = &YYMD;
-DONE
If you wanted to get fancy, you could set additional variables to customize the date further. The following example uses a function to set the value of the global variable to be a week from today:
-SET &CURDATE = &YYMD;
-SET &&TIME_DATE = AYMD(&CURDATE, 7, 'YYMD');
-DONE
Next, the path of this FOCEXEC, which you can get from the Properties panel on the Home Page, would need to be added to the Paths to be executed on user Sign-in property in the Administration Console, on the Other page.
Finally, add content that has a dynamic parameter for Sale Date to a page. You should be prompted to add a filter. Once added, select the filter control and open the Properties panel. On the Settings tab, in the Data Settings area, set the Default value to the name of your global variable (for example, &&TIME_DATE). Save the page, then sign out of WebFOCUS and sign back in again to run the FOCEXEC to set the global variable. When you run the page, the default value should be the one you set.


Director, Technical Content Support Services