NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Alan Telford on June 18, 2008, 07:37:30 PM

Title: Display extra fields in drop list?
Post by: Alan Telford on June 18, 2008, 07:37:30 PM
How do I display extra fields in drop list.

This works fine for a single display field:
  Display = EMP:Name
  Value  EMP:ID

But how do I do the following:
  Display = EMP:FirstName & ' ' & EMP:Lastname
  Value  EMP:ID

i.e. I want a calculated field to show in the dropdownlist.
Is this possible?

Alan
Title: Re: Display extra fields in drop list?
Post by: Bruce on June 19, 2008, 07:22:02 AM
Hi Alan,

yes, the dropped field can be an expression.
Although, in your case, a better expression would be

Description Field:
clip(EMP:FirstName) & ' ' & EMP:Lastname

Also, remember to add Emp:FirstName, and Emp:LastName to the hot-fields list for the drop down.

Cheers
Bruce
Title: Re: Display extra fields in drop list?
Post by: Alan Telford on June 19, 2008, 12:59:27 PM
Thanks so much!!!
 I'd tried before, but I guess I'd probably forgotten to add the extras as HOT fields.
Title: Re: Display extra fields in drop list?
Post by: charl99 on September 16, 2008, 06:07:12 AM
Hi Bruce,

OK, let's get real nasty...

I have 2 files, Sections and Perils, linked something like this

Section   PerilCode
    1          FIRE
    1          WATER
    1         ACDA
    2         FIRE
    2         ACTP
...
   99       FIRE


PerilCode    Description
ACDA        Accidental Damage
ACTP         Accident Third Paerty to Blame
FIRE           Fire
WATER      Water damage - Burst Pipe

Obviously I have a Filter on the Section File to display only that Section, Problem comes into trying to show description on Peril file.  The app uses NetWebForm from memory, so I am trying to populate local:test.

The problem is I can't link Perils to Sections in [Tables] and I cannot put the Advanced Link File Perils in options without having it in [TABLES], so the view generate the Peril Description outside the join statement...

l:test_OptionView   View(SectionPerils)
                          Project(SPer:PerilCode)
                          Project(PER:Description)
                          JOIN(PER:KeyPerilCode,SPer:PerilCode),INNER
                          End
                        End

                 and generate error Field not found in parent FILE      (UsingNetTalk 4.30)

Any ideas?

Charl
Title: Re: Display extra fields in drop list?
Post by: Bruce on September 16, 2008, 11:41:50 PM
>> The problem is I can't link Perils to Sections in [Tables]

Why not? Do you have a relationship defined in your dictionary?

Cheers
Bruce
Title: Re: Display extra fields in drop list?
Post by: charl99 on September 17, 2008, 12:21:42 AM
Yep, Perils 1:MANY SectionPerils.

The problem is that 'Related Tables' Tab is nos in the NetWebForm Template, see the attachment.

Hope this help.

Thanks

Charl

[attachment deleted by admin]
Title: Re: Display extra fields in drop list?
Post by: Bruce on September 17, 2008, 11:04:31 PM
Hi Charl,

ah - yes - I follow you now. Thanks for the doc.

Just one question - Are you hand-coding any of that JOIN statement?

Cheers
Bruce
Title: Re: Display extra fields in drop list?
Post by: charl99 on September 18, 2008, 03:26:39 AM
Bruce,

Short and Sweet, Nope. 

Charl
Title: Re: Display extra fields in drop list?
Post by: Bruce on September 18, 2008, 07:05:48 AM
Hi Charl,

great - I've got you 100%.

2 things;

a) I've added code to PR 14 so the Join gets done for you. You'll add the file to the Tables button, and add it as a HotField - but the template will just generate the VIEW correctly...

b) you've set the "Link File" in an attempt to make it work - but that's wrong, so just remove that setting.

If you're in a big hurry, then the workaround for this is;
a) remove the field as a hotfield
b) hand-code the Join inside the view (in the provided embed point).
c) and of course remove the incorrect link file mentioned above.

Cheers
Bruce
Title: Re: Display extra fields in drop list?
Post by: charl99 on September 19, 2008, 05:08:41 AM
Bruce,

Cool.

But I am a mad man, I just removed the thing and allocate it a code 99, something like Web Thingy Peril Code for now.  Easy work-around...  In the proper app I make sure they change that.

I'll check it next week.

Cheers

Charl