|
Having finally been given permission to design and implement a service
program that will be placed into production and serve as a proof-of-concept
for my colleagues who have no to little experience with developing service
programs, I am striving to make this first one something that can be used
as a reference for others.
In our shop, we make extensive use of F4=Prompt on certain input-capable
fields to display a window subfile that allows the user to select from a
list of valid records populated by a master file. Two "biggies" in our
shop are Organization and Sub-Organization, aka Org and SubOrg. Currently,
all of this logic is replicated in every program that uses it, one
subroutine for each master file that we prompt for in any given program.
In every case, only one selection from the window subfile can be made.
Based on this, I am designing my prototype as follows:
1) The return value will be either 'Selected' or 'Canceled', based on
whether the user made a selection from the window subfile.
2) If there are any key values needed to filter the subfile list, those are
the first parameters. In my example, SubOrg requires the Org key value to
filter the list. Org has no "higher level" key (my terminology sucks,
sorry) for which Org can be filtered.
3) The last parameter is the database record selected by the user.
d PromptWindowOrg...
d pi 10a
d SelectedRecord LikeRec( RstIndx02 )
d PromptWindowSubOrg...
d pi 10a
d OrgID 4a
d SelectedRecord LikeRec( SubOrgL2 )
Usage example:
If PromptWindowOrg( SelectedRecordOrg ) = 'Selected';
... do stuff like set display's Org ID and name field values to that
returned by procedure
Endif;
If PromptWindowSubOrg( xx_OrgID : SelectedRecordSubOrg ) = 'Selected';
... do stuff like set display's SubOrg ID and name field values to that
returned by procedure
Endif;
Suggestions / corrections / opinions are welcome. I'd also welcome any
online resources. I'm still somewhat early in the design that I can change
this as required / desired.
- Dan
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.