NetTalk Central

Author Topic: Memory Form - local variables - button server code  (Read 3147 times)

JohanR

  • Sr. Member
  • ****
  • Posts: 375
    • View Profile
    • Email
Memory Form - local variables - button server code
« on: May 28, 2013, 09:26:13 AM »

Hi,

I have a memory form with some local variables, all validation is switched off on these variables,
they are just local entry fields on the form.

Below I have a custom button with some server code doing something with these variables.
Using either, session or local variables, both end up empty in the server side code.

How do I make sure that the values are updated to the session or the local vars when I execute the server code linked to the button?



thanks

Johan

JohanR

  • Sr. Member
  • ****
  • Posts: 375
    • View Profile
    • Email
Re: Memory Form - local variables - button server code
« Reply #1 on: May 28, 2013, 09:59:56 AM »


Hi,

Best I have is to "Send value to server" on each variable,
and then in the button server code I assign the values from the session queue to the local variables.

Code executes, and then I assign local variables back to session queue.

Are there better ways to do this?
Any pitfalls with this method?

thanks

Johan

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Memory Form - local variables - button server code
« Reply #2 on: May 28, 2013, 09:30:19 PM »
you've hit it spot on. Don't think of them as local variables at all.
Just think of them as session values, read them from the session queue and write them to the session queue and you'll be fine.

cheers
Bruce

JohanR

  • Sr. Member
  • ****
  • Posts: 375
    • View Profile
    • Email
Re: Memory Form - local variables - button server code
« Reply #3 on: May 28, 2013, 10:05:57 PM »


Hi Bruce

Thanks.
Just trying to make sure that I am doing the most effective way.


Johan