Lucky . Posted April 9, 2021 Posted April 9, 2021 Hello All, I am trying to populate last few years in auto prompt list without hardcoding the years. If I hardcode the years code works fine and I can see all the years in the dropdown list without any issues. But when I use amper variables for years instead hardcoding I get error. Please refer following code. IF I USE > -SET &SYR = &EFFYR.(<2017,1017>,<2018,2018>,<2019,2019>,<2020,2020>,<2021,2021>).Select Year. ; -->INSTEAD OF OTHER &SYR MENTIONED BELOW I DO NOT GET ANY ERROR. -CODE****** -STAT = &STATUS.(<All,All>,<Active,Active>,<Inactive,Inactive>).Select Status. ; -*YEAR CATEGORIES -SET -SET &4YRTITLE = DATECVT(DATEMOV(DATEADD(DATECVT(&YYMD,I8YYMD,YYMD), Y,-4, BOY), YYMD,YY); -SET &3YRTITLE = DATECVT(DATEMOV(DATEADD(DATECVT(&YYMD,I8YYMD,YYMD), Y,-3, BOY), YYMD,YY); -SET &2YRTITLE = DATECVT(DATEMOV(DATEADD(DATECVT(&YYMD,I8YYMD,YYMD), Y,-2, BOY), YYMD,YY); -SET &1YRTITLE = DATECVT(DATEMOV(DATEADD(DATECVT(&YYMD,I8YYMD,YYMD), Y,-1, BOY), YYMD,YY); -SET &0YRTITLE = DATECVT(DATEMOV(DATEADD(DATECVT(&YYMD,I8YYMD,YYMD), Y,0, BOY), YYMD,YY); -SET &SYR = &EFFYR.(<&0YRTITLE,&0YRTITLE>,<&1YRTITLE,&1YRTITLE>,<&2YRTITLE,&2YRTITLE>,<&3YRTITLE,&3YRTITLE>,<&4YRTITLE,&4YRTITLE>).Select Year. ; -TYPE STATUS>&STATUS EFFYR>&EFFYR SYR>&SYR -EXIT
Warren Hinchliffe Posted April 11, 2021 Posted April 11, 2021 The issue is that for the client to populate the values it reads them, but its done before the fex is executed, so it can only be hard coded or a pull from a table. How does this list change seem to be related to the current date. Perhaps you can create a fex that executes on login that populates a hold file in FOCCACHE, and use that file as a data source in the prompt
David Beagan Posted April 12, 2021 Posted April 12, 2021 If you create a master file that calls a fex, you can make it fully dynamic. ( Reference: Creating and Using a Master File Profile ). You can try it, create the following two files in baseapp: yearlist.mas FILENAME=YEARLIST, SUFFIX=FIX, MFD_PROFILE=yearlist.fex, $ SEGMENT=YEARLIST, SEGTYPE=S0, $ FIELDNAME=YEARS, ALIAS=E01, USAGE=A4, ACTUAL=A4, $ yearlist.fex FILEDEF yearlist DISK foccache/yearlist.txt -RUN -WRITE yearlist &DATEYY -SET &Year = &DATEYY - 1; -WRITE yearlist &Year -SET &Year = &DATEYY - 2; -WRITE yearlist &Year -SET &Year = &DATEYY - 3; -WRITE yearlist &Year -SET &Year = &DATEYY - 4; -WRITE yearlist &Year Then you can use it in your fex to get the prompting: &YEAR.(FIND YEARS IN YEARLIST).
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now