NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: pkonyk on September 18, 2014, 01:51:22 PM
-
I have give you an example Bruce. I've been fighting with this for several weeks on and off.
Here is the situation. A table with only two key fields -- the primary (unique, auto numbered) and a description (unique) field.
Some sample data:
ID Description
1 A01
2 A02
...
6 32 ! Yes this is the description that is a number and matches an ID
...
10 57 ! Another description that is a number and matches an ID
...
32 A19
...
57 S21
Your code in NetWeb.clw in NetWebServerWorker.GetDescription will fail for description "32" and description "57". This because
err = self.GetFile(p_file,CodeKey) !line 10266
will be set to 0 since 32 (as a description) will be found in the ID field and "A19" will be returned as the description. And if 57 (as a description) is looked for the result will be "S21".
In summary, because the description field matches an ID entry (by coincidence) an incorrect description and ID is returned.
I suggest that you add a template option. Something like, "Use description key only for look ups"
Cheers,
Paul
-
Hi Paul,
I understand the issue, and I'll consider a switch - but the ability to enter both the code or the description is by design, and I wouldn't want to lose that.
I've split this into a separate thread because it has nothing to do with Brians report on the locator that I can see.
cheers
Bruce
-
Thanks Bruce!
I've struggled with disabling / overriding this "by design" behaviour. I have to keep changing the value that is looked up. And, just before the write to disk, I change it one last time.
Could you suggest the most efficient / effective way of doing this?
Cheers,
Paul
-
Hi Paul,
I've added a switch in 8.27 as you suggested.
At this stage though I haven't tested all the code, so if it doesn't work please maybe post a small example of appropriate app & data etc.
Cheers
Bruce
-
Thanks Bruce!
I'll give it a workout and report back, with an example if needed.
Cheers,
Paul
-
Hi Bruce,
Using NetDebugView, I see that the correct values are set when using the new switch. However, nothing is displayed on screen.
I have attached a demo app. It is complied with the switch set. Try it both ways. The problem field is Labour Code.Type in each of these codes 32, 32, 57 and 95. That will show you what is happening.
Cheers,
Paul
[attachment deleted by admin]
-
fixed in 8.28