NetTalk Central

Author Topic: Server side code not firing on Change  (Read 4345 times)

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Server side code not firing on Change
« on: December 12, 2011, 01:24:00 PM »
When INSERTING a field on a form I have code to update another field which is working fine. However when I EDIT that record and change the fields the code does not fire.

Example: Enter First Name and Last Name and derive Full Name. On Insert FullName = First Name + Last Name but on Edit, even if First and/or Last Name is changed the FullName does not change.

John

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Server side code not firing on Change
« Reply #1 on: December 12, 2011, 10:45:23 PM »
what is your code, (exactly) and where (exactly) did you put it?
tip: Name the routine where it ends up, not the embed point name - that's more useful to me.


cheers
Bruce

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: Server side code not firing on Change
« Reply #2 on: December 13, 2011, 12:49:02 AM »
The code is Routine/General/Field/2 Validate/Add Server Side Code and is:

p_web.SSV('CON:FullName',Left(Clip(p_web.GSV('CON:FirstName'))) & ' ' & Left(Clip(p_web.GSV('Con:LastName'))))

I suspect I am using the wrong embed point although that is where it took me. I scoured the book and docs but could not find what the differences between Validate 1,2,3 are.

Thanks

John

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Server side code not firing on Change
« Reply #3 on: December 13, 2011, 07:22:14 AM »
Don't look at the embed tree. Look at the generated source. ie Right-Click on a procedure in the app tree and choose source.
the embed tree is sorted alphabetically, so 1,2 and 3 are just use for order. However to understand why there are 3 of them you should look at the source.

One should always look at the embedded code in context - reading the code around your embed code to see if what you're doing is in the right place, and in harmony with the code around it.

Incidentally, answer the question again, what is the location, by referring to the routine name in which it has been embedded.

Cheers
Bruce

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: Server side code not firing on Change
« Reply #4 on: December 13, 2011, 07:53:21 AM »
Validate::Con:LastName Routine

Thanks

John

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Server side code not firing on Change
« Reply #5 on: December 15, 2011, 10:23:53 PM »
Right, so you've added it to the LastName, field but not FirstName field.
If you want it to happen on either field, then you need to add it to both fields.

cheers
Bruce