NetTalk Central

Author Topic: Is this a major bug in 6.10?  (Read 3587 times)

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Is this a major bug in 6.10?
« on: December 17, 2011, 03:56:00 AM »
I cannot upload my images despite being small (upload folder full) so will have to describe this. Will try to at least send the tps screenshot.

First of all I have created a new test app and checked absolutely everything and all is absolutely fine. The test app fails as done my main one. So ...

On a form I have several lookup fields using drop downs. For this example I have Contact and Breed. Contact uses a Long but Breed is a String.

When I enter information into the form the Contact ID is replaced with the name value as it should and the breed is replaced with the string value as it should.

BUT when I save the record, the ContactID is saved correctly but the Breed assumes the contactID!!! It should be a string.

The dictionary uses a string, the lookup criteria for the Breed uses the string field and the form displays a string.

So if the ContactID is 2 and the Breed ID is 1 then my tps file ends up with ContactID = 2, Breed = 2

It should be ContactID = 2, Breed = 'whatever'

So not only has it not added the breed as a string but it has not even assumed the correct ID but used the Contact ID.

Have I gone mad? My aplogies if I have.

John


John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: Is this a major bug in 6.10?
« Reply #1 on: December 17, 2011, 04:44:11 AM »
I have since sent the test app to Bruce as I cannot attach anything here.

I really do hope I have not gone mad!

John

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: Is this a major bug in 6.10?
« Reply #2 on: December 17, 2011, 08:04:52 AM »
Also been having other issues all it seems associated with drop downs. Have tried going back to 6.08 but no difference.

I am beginning to think this is a long standing problem in that if you have MORE THAN 1 drop down on a form the session variables are getting screwed up somewhere.

After much confusion and trying different things, the only conlcusion I can come to is that if you have ONE drop down on a  form then all is OK. That is  a serious limitation and for me devastating as my app is now unusable.

John

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: Is this a major bug in 6.10?
« Reply #3 on: December 17, 2011, 08:56:29 AM »
FOUND IT!

I publically apologize to Bruce but I really did feel something was broke. Maybe I should have realized.

Anyway, if you have a  field which is a lookup button and is a type STRING you MUST NOT check "Display Description instead of Value" in the pop up settings.

I see what is probably happening under the bonnet. It suspect it is trying to retrieve a record using a value of the string, failing and reverting back to the last session variable held in memory.

Personally I think this is something that should be changed in the template. So if it is type STRING do not allow the checkbox to be checked. Maybe no one else is as stupid as me. But I will not be doing that again in a hurry!!!

Sorry if I have caused any confusion.

John

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Is this a major bug in 6.10?
« Reply #4 on: December 19, 2011, 06:24:34 AM »
Although you're on the right track, the root of the problem is not quite what you've described.
I recommend reviewing the section on Lookups in the "Building Web Applications" book. Circa page 35.

The key issue you have is that you are using non-normalised data. Take the Sex table for example. This has a code field, and a description field (which is what I expect) but the _description_ field is actually copied into the Patient table rather than the ID field. This is less ideal because it means your dictionary is "not normalised". In a normalised dictionary the _id_ field is the "shared field", not the description field.

More technically - "the primary key field of the child table (sex) is used as the foreign-key field in the parent table (patient)."

Ok, so you have non-normalised data. that's not great, but you're not the only one doing it. However if you do it then the concept of "using value instead of description" has no meaning.

BTW - be _very_ careful when using the term "drop down". A drop-down is a specific control which is different to a "lookup". I notice your test example had lookups, not drop-down, so be careful of that.

Cheers
Bruce