NetTalk Central

Author Topic: must be in file problem  (Read 3101 times)

carlossm

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • Email
must be in file problem
« on: December 31, 2013, 05:18:46 PM »
Hi, I've got an odd problem. I have a webserver app created with the wizard. There is an update form to enter appointments. There are 4 fields with a browse button each to select Customer and other data from other tables. When I try to save an appointment, two of the fields give me a "XXX must be in file". I've checked the relationships and they are fine. There are two other columns that also have relationships to other tables and those are ok.
I'm using FM3 and ODBC driver with MySQL.

Thanks
Carlos San Miguel

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: must be in file problem
« Reply #1 on: December 31, 2013, 10:05:59 PM »
Must be in file is a validation setting in the dictionary - ie something you've set on the field level validation tab.

Question is -are the values it is complaining about in the file?

Assuming they are - are there single component keys on the description fields in those lookup files?

Happy new year
Bruce

carlossm

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • Email
Re: must be in file problem
« Reply #2 on: January 01, 2014, 09:03:28 AM »
Hi Bruce, I found the problem and I don't know if it's by design or a bug.
The Appointment table has a primary key and a key on the customer's last name. Now, on the field's properties on the form I have:

From table  Pacientes(this is the customer table)
Order by     Nombre(this is the customer's name)
Value field  Paciente:ID(this is the unique key)
Description field   Paciente:Nombre

and I have "display description instead of value" checked.

I did not have a key defined on the "Nombre" column, so nettalk was generating the following code in the ValidateRecord routine

  loc:ok = p_web.GetDescription(Pacientes,Paciente:KID,Paciente:KID,Paciente:ID,Paciente:Nombre,p_web.GetValue('Cita:Paciente')) !4


notice the second and third parameters are the same variable, as soon as I created a key on the Name column nettalk generated the third parameter with Paciente:KNombre(which is the Nombre key)

  loc:ok = p_web.GetDescription(Pacientes,Paciente:KID,Paciente:KNombre,Paciente:ID,Paciente:Nombre,p_web.GetValue('Cita:Paciente')) !4

And that solved the problem.

Thanks and Happy new year.
« Last Edit: January 01, 2014, 09:25:42 AM by carlossm »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: must be in file problem
« Reply #3 on: January 01, 2014, 11:49:45 PM »
>> by design or a bug.

By design.

If you have "Use Description instead of value" ticked on then a single-component key for the Description field must exist.

cheers
Bruce