The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
|
|
Using a view in a lookup
Posted: 29 Jul 08 2:08 PM
|
Is there anywhere I can find documentation on how to use the listed "view" for a lookup? I have a challenge where I'd like to get three pieces of info back from a lookup rather than the usual 2 and I was thinking the view might help. Problem is I can't find any references as to how to use it.
Maria |
|
|
|
Re: Using a view in a lookup
Posted: 29 Jul 08 3:30 PM
|
grab the ID value and go out and get the data..... DIM ADATA(), strID strID = lueControl.LookupID IF strID > "" THEN IF GETFIELDS("fields", "table","conditions fieldID = '" & strID & "' ",ADATA) THEN 3rdField = ADATA(1)
END IF END IF |
|
|
|
Re: Using a view in a lookup
Posted: 29 Jul 08 3:57 PM
|
Unfortunately I'm looking up a value in a one to many table off the actual table for the lookup. Basically the user looks up a marketing code to find a fee. The particular fee might have several marketing codes. I want to capture the fee amount, ID of the fee record, and the marketing code the user selected.
What I've done is added a lookup to get the marketing code, then use the ID for the marketing code record to get the fee record ID and amount for the fee lookup. I was hoping for a simpler method as I have about 30 iterations of this. So now I'm creating logic in my code so one routine can do all 30 based on the related object names.
Unless of course someone comes up with something easier!
I was hoping the view would allow me to capture the marketing code to a global to return to the form but I can't figure out how to use a view with a lookup.
Maria |
|
|
|
Re: Using a view in a lookup
Posted: 30 Jul 08 1:42 AM
|
Sounds like you are trying to force the lookup to do too many things at once ...
But I am not 100% sure I understand the process.
The user selects a fee and then one of several (associated) Marketing codes?
So you have FeeID, Fee in one table and MarketingID (foreign key to FeeID) and Marketing Code in another?
And you want to be able to display all available Marketing Codes when a user selects a particular Fee and then capture what is selected (in a hierarchical way, similar to Area / Category / Issue on a Ticket)?
Phil |
|
|
|
Re: Using a view in a lookup
Posted: 30 Jul 08 5:08 AM
|
Actually the user selects a marketing code, which only has one related fee. This works well to get me the fee record ID and the fee amount. The problem was I need to trap the code the user selected as well since more than one code could have gotten them to that fee.
I've solved it with a second lookup to find the code, which brings me the code itself. On popup return of that lookup I capture the record id for the fee and the amount.
At the end I'm still curious as to what the view in a lookup does and how to set one up. I can't find any documentation, or examples, to research this. It could be a handy tool if I knew what it was.
Maria |
|
|
|
Re: Using a view in a lookup
Posted: 03 Aug 08 8:52 AM
|
I've never seen any documentation on this either (along with a lot of other "undocumented" things . |
|
|
|