DBColumn - OnSelect

Posted on 2003-02-20
Medium Priority
Last Modified: 2013-12-18
I have a dialogbox 'CustName' with a @DBColumn to get its selection values.  Once the user has selected the value from the dialog box I have a number of editable fields e.g 'address','phone' which I want to populate by a DBLookUp to a view for the details.

How can I do this? Do I use the OnSelect?
Question by:fayeb
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 7986625
Use @DbLookup to find the matching values by passing the selected value. Then populate the values on the fields. If these can be computed they can automatically populated if they are editable then you might have to look for some roundabout way like clicking a button or writing the code in appropriate events (not an efficient way though).

Check @DBLookup help on details of how to get the values.


Author Comment

ID: 7986663
They have to be editable as users have to be able to add a new cust as well as select new ones.
LVL 13

Expert Comment

ID: 7986664
You could also use @Picklist instead of the @Dialogbox, and retrieve @Text(@DocumentUniqueID) from a hidden column.
Using @GetDocField you could obtain one or more fields without additional (slow) @DbLookups.

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.


Author Comment

ID: 7986675
The application is web so I cant use @picklist

Author Comment

ID: 7986723
The application is web so I cant use @picklist
LVL 13

Accepted Solution

CRAK earned 400 total points
ID: 7987722
For the web I often use a different approach. I prefer this method because it doen't need any refreshes or (slow) @DbLookups. I haven't got a working example around, but if you know some javascript, here's how it works:

Create a page or form. It's contents should be interpreted as HTML.
On it you place a view in HTML, delivering the options for the HTML select statement, providing the text (what to select) and the values (alias). The values can be the concatenated value for the different fields, like:

  <OPTION VALUE="value1@value2@value3">Choice 1
  <OPTION VALUE="valueA@valueB@valueC">Choise 2
  <OPTION VALUE="valueX@valueY@valueZ">Choise 3

Add the proper HTML around it:

<SELECT NAME="myField" onChange="
  i = this.selectedIndex;
  v = this.options[i].value.split('@');
  opener.myFunction(v)" Size=5>
...(place the view with the options here)...

And you've got the engine for a dialogbox in HTML/Javascript.

The opener window (where you trigger the dialogbox) should contain a javascript function to receive/distribute the field values:

function myFunction(v)

All you have to do now is change the current action that opens the dialogbox into a javascript window.open(), launching the page or form. Depending on wether you use a $$viewtemplate or an embedded view, you should open the view's or the page/form's URL.
From the action, the function or even in the onChange, you should be able to close the opened pop-up window again.
LVL 24

Expert Comment

ID: 7987946

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month13 days, 16 hours left to enroll

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question