NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: John Fligg on March 01, 2012, 07:39:46 AM

Title: Problem with lookup value
Post by: John Fligg on March 01, 2012, 07:39:46 AM
I am not quite sure how to explain this but will try.

I have a Contact record which has a key of fullname. I have a related record Patient which has to store the Contact GUID. Pretty standard stuff so far.

So on the Patient form I have a button to Select a Contact. The lookup settings are as shown.

All works perfectly until I add a Contact with no First Name. Here is what happens:

I select the Contact. The Contact name is entered successfully. In Complete Form I show Pat:ContactGUID which is correctly shown. However, when the Patient record is actually saved it is saving the Fullname in the patient Contact GUID field.

To me that makes no sense. But the way to correct this is to enter a First Name.

Because FullName is made up of First Name + space + LastName I am assuming that the preceding space is the issue here.

If this makes sense can anyone explain why this is happenignnand what can be done.

Thanks

John

[attachment deleted by admin]
Title: Re: Problem with lookup value
Post by: kevin plummer on March 01, 2012, 03:20:12 PM
space is possibly a prob on a key

try FullName = left(First Name + space + LastName)
Title: Re: Problem with lookup value
Post by: lanmicro on March 02, 2012, 12:40:14 PM
try

FullName = left( clip( First Name ) &' '& LastName )

or

if FirstName = ''
  FullName = LastName
else
  FullName = left( clip( First Name ) &' '& LastName )
end