× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Because the F4 field from file to file varies in length I could not figure out how to do a fits-all-files dropdown box. In the end I opted for a generic dropdown box that can be fitted for each file's fields, as might be needed.

**

* A program to display a dropdown box, with mouse pick. *
* Features: *
* - If a parm is used then a mouse click on an item will *
* return the clicked record as a choice.
dropdown box <http://www.martinvt.com/SQL_-simple-/SQL_Dropdown/sql_dropdown.html>
This example is not a procedure, but I suppose it could well be done as a procedure.

**
On 8/4/2017 1:24 PM, Dan wrote:
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 thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.