Precisely Speaking
February 04, 2012, 06:49:49 PM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
: So what's news with you? Tell us about it in "Getting To Know You"!
Home
Help
Calendar
Login
Register
Precisely Speaking
>
Training and Education
>
SB+ Programming Questions
>
Populating display fields
Pages: [
1
]
Go Down
« previous
next »
Print
Author
Topic: Populating display fields (Read 852 times)
rcoop
Associate
Posts: 6
Populating display fields
«
on:
May 13, 2010, 02:27:02 PM »
I have a question that I'm sure any of you can help me with.
I've been reading the 'SB+ Solutions' manual and I can't seem to find what I need. BTW if you have suggestions for any other manuals could you pass a link my way?
I just created a screen where some fields are entered by the user and other fields are just for display purposes.
I want to populate the displayed fields with a record read from an auxillary file. How do I set the values in the displayed fields from the record that I am reading? Do I do that in 'Proc After'? If so how do I do that?
I know there is a section in the Sb+ solutions manual for 'Defaults', but it doesn't seem to answer my question.
thx,
rudy
Logged
precisonline
President/Chief Technologist
Administrator
Rock Star
Posts: 1524
Re: Populating display fields
«
Reply #1 on:
May 13, 2010, 02:47:21 PM »
There are a number of ways to achieve what you're after. The first question I would ask is under what condition is the other record read and the fields in the current record populated?
One approach would be to use a Process After on a field to read the other record, and then use the fields in that record to update fields in the current record and then set @REFRESH = -2 to redisplay everything. All this can be done using a paragraph or BASIC subroutine called from any field level PA.
Another approach could be done by using mandatory defaults on each of the fields that are coming from that secondary record, and then use the F10-Action | Recalc to setup a recalculation on those secondary fields based on when the original field changes. This might be less efficient than the other approach, however, because you lose a little control over when the record is read and usually end up re-reading the same record for each of the defaults, which - depending on the number of fields - could be a lot of unnecessary I/O.
Logged
-Kevin
Accidents "happen"; success, however, is planned and executed.
precisonline
President/Chief Technologist
Administrator
Rock Star
Posts: 1524
Re: Populating display fields
«
Reply #2 on:
May 13, 2010, 02:55:49 PM »
Another question: Do you need those fields in the current record? Or could you use Derived Value expressions (i.e. using the F(..) expression element) to read those fields from the secondary file?
Logged
-Kevin
Accidents "happen"; success, however, is planned and executed.
rcoop
Associate
Posts: 6
Re: Populating display fields
«
Reply #3 on:
May 13, 2010, 04:35:44 PM »
Hi,
thx for responding.
There are a number of ways to achieve what you're after. The first question I would ask is under what condition is the other record read and the fields in the current record populated?
The 'other record' read is unconditional, i.e., always.
Another question: Do you need those fields in the current record? Or could you use Derived Value expressions (i.e. using the F(..) expression element) to read those fields from the secondary file?
I do need to display them and file them in the current record. I was reading up on the derived values and thought that i might use that. The only problem is I need to get 4 different fields from 2 different files and have them displayed on the user screen after the product number is entered (the first prompt on the screen, which is the primary key to my main file). Since I have 4 fields that need to be extracted from 2 different files, I thought I would use a subroutine to create the derived fields instead of an expression. Would that make sense? The problem I'm having now is trying to understand where I call the subroutine, I'm assuming it's in Process After for the first prompt and then once I get the results what variables do I set them to in my subroutine so that they display correctly on my screen? In my screen definition I have a field called PLOC, which is a skipped field, I want this for display only. In my subroutine how do I set a value to PLOC so it gets displayed?
thx,
rudy
Logged
precisonline
President/Chief Technologist
Administrator
Rock Star
Posts: 1524
Re: Populating display fields
«
Reply #4 on:
May 13, 2010, 09:29:12 PM »
I believe this is your key:
Quote
after the product number is entered (the first prompt on the screen, which is the primary key to my main file).
Based on this I would tend to suggest using the Process After Read on the screen; that should be the next process to be called after the main record has been read, and therefore it's the first process slot that can populate that record.
Logged
-Kevin
Accidents "happen"; success, however, is planned and executed.
Pages: [
1
]
Go Up
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> Getting To Know You
=> Announcements
=> Big Thoughts / Cool Ideas
=> Rants & Raves
-----------------------------
Application Support
-----------------------------
=> Red Leaf
=> Activant/Prelude Support
=> Summit Support
=> Avante Support
=> PRC Support
-----------------------------
Training and Education
-----------------------------
=> Connect!
=> U2 Programming Questions
=> SB+ Programming Questions
=> Web Programming Questions
=> Business Intelligence / MITS
=> PC / Hardware / Miscellaneous Support
Loading...