NetTalk Central

Author Topic: EIP Lookup  (Read 4885 times)

wasatchconsulting

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
    • Email
EIP Lookup
« on: June 09, 2013, 02:38:37 PM »
I am using EIP string field on a browse that has a lookup. When I type in an entry that matches a record in the lookup file it says "Field Invalid". When using the same lookup in a form it works just fine. In addition, when I click on the "?" next to the field to select a record, no records appear to select. Everything works just fine from a form field using the same field and lookup. What I am doing wrong?

Ken Watts
Wasatch Consulting Services

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: EIP Lookup
« Reply #1 on: June 09, 2013, 09:15:45 PM »
I have no idea what you are doing wrong - but clearly you've done something wrong. Perhaps replicate the effect in an example and post the example?

cheers
Bruce

wasatchconsulting

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
    • Email
Re: EIP Lookup
« Reply #2 on: June 13, 2013, 08:02:11 AM »
I tried the same setup in the web21 example. At first, it gave me the "Field Invalid", but I realized that I had used a lookup field that was a numeric field with a string field. Changed it to match and the process stopped giving me the error and accepted the entry. I went back to my app and looked to see what the two field types were and they were both cstring and the same size. My application properties appear to be identical to the example. The question that I would have before posting a example of what I am doing, what causes the "Field Invalid" error and what are the rules for the EIP field so that this error does not appear.

Ken Watts
Wasatch Consulting Services

wasatchconsulting

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
    • Email
Re: EIP Lookup
« Reply #3 on: June 13, 2013, 02:02:42 PM »
After further testing, I have found that the problem only exists when using a lookup with the EIP field. This holds true with the web21 example. If you add the lookup to the example, then the update does not work. The EIP does not get updated and you get an error 40 in the example web21 app. If I do not use the lookup, I do not get the "Field Invalid" error, but as soon as I add the lookup back, if I try typing anything in, it gives me the "Field Invalid" and the lookup does not work.

Ken Watts
Wasatch Consulting Services

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: EIP Lookup
« Reply #4 on: June 14, 2013, 01:15:25 AM »
perhaps you can post your modified example 21 Ken?

I got a bit stuck on
>>  If you add the lookup to the example, then the update does not work.

lookup what? on what browse?
more info please!


update 1 : I've duplicated something - not sure if it's the same as you - but certainly something wrong with the Lookup EIP in a browse.

update 2 : No, not a bug. I made a mistake when implementing the browse column - I used the INV:Customer field - and because that is a number it defaulted the picture (from the dict) to @n14. Because I want to be able to display a name there (because the lookup option has "display description instead of value") I had to set the pic to ''.

which I guess raises an interesting point - if it's showing the description, then maybe it should not format the result. (ie the pic should not apply). I'll have to think about that.

cheers
Bruce
« Last Edit: June 14, 2013, 01:42:55 AM by Bruce »

wasatchconsulting

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
    • Email
Re: EIP Lookup
« Reply #5 on: June 18, 2013, 10:13:00 AM »
Bruce,

I found my problem. I started from a new browse and worked through it. It was working until I placed some custom code in the "Procedure Setup". It boiled down to the following line of code:

p_web.SetSessionValue('StoreID','100')

When the procedure processes the "Procedure Setup" the first time, no problem. But this code is being processed every time you edit any EIP field. In fact, when you click into a EIP field, the "Procedure Setup" is processed. I have placed code so that this code is only processed once as there are things in that code that I absolutely want processed only once.

Is there are reason the "Procedure Setup" code is processed every time anything is processed for that procedure?

Thanks
Ken Watts
Wasatch Consulting Services

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: EIP Lookup
« Reply #6 on: June 20, 2013, 12:17:15 AM »
Hi Ken,

yeah ProcedureSetup is not _usually_ the right place to embed anything.

In a windows program if you open say a browse procedure, then the procedure is "running" for the whole life of the browse. It's one procedure, called once. The code "stays inside" that procedure until the browse is closed.

In a web program it's quite different. In a web program the procedure is called (because Firefox or whatever made a request), it generates some HTML or whatever, sends that back to the browser, then finishes. The whole thing lasts for maybe a tenth of a second. If the user then does something else (click on a row or whatever) then a new request is made and the browse procedure is called again. It genreates a response and so on.

So while the user in Firefox is "seeing" the browse, there is nothing happening on the server. And everything they do something the browse procedure on the server is called again. The "life" of the browse may result in many many calls to the browse procedure.

Internally of course the browse procedure follows a different path depending on what the user is "requesting". In your case the top of the "Generate Browse" routine is likely to be a better place than "Procedure Setup" - but remember that even that can be called many times, when the user Pages, or changes the Sort order and so on.

cheers
Bruce