NetTalk Central

Author Topic: Field value filling another field  (Read 5240 times)

Mike Grigsby

  • Sr. Member
  • ****
  • Posts: 380
    • Yahoo Instant Messenger - onthedotsoftware
    • View Profile
    • MyHomeAssets! Software (among others)
Field value filling another field
« on: September 16, 2008, 08:48:21 PM »
Just when I think I've got a handle on how to send the value of one field to another, I end right back to square one again.

I downloaded and installed the lastest release last night (13 or 14?) just to make sure I'm on the newest release.

I've got Make and Model that I want to combine to prefill the items description. So it my be Porsche 911 (make and model). For now, I'm just trying to get the model to prefill the description, so on my form field, CAR:Model, Client Side tab, I've got checked the Send new value to server, and I've got the simple code in that embed:

p_web.SetSessionValue('CAR:Description',CAR:Model).

Eventually I'll be making it: p_web.SetSessionValue('CAR:Description',CAR:Make & ' ' & CAR:Model), but for now I'll settle for one field.

I've also indicated that the CAR:Description field value is reset.

It doesn't do a thing when I save the form, and the browse shows the old value still. But when I open the form back up, NOW I get the model to appear in the description field. So it's like everything is being ignored through saving the form. Any ideas on what I'm doing wrong? The Calculator example just isn't cutting it for me<g>.
Mike Grigsby
Credify Systems
Central Oregon, USA

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: Field value filling another field
« Reply #1 on: September 16, 2008, 10:56:27 PM »
Hi Mike,

It all sounds like you're doing it right. But...

personally I would try
p_web.SSV('CAR:Description',p_web.GSV('CAR:Model'))
It's a better habit to use session variables rather than file variables.

I think though, going back to your error, it would be helpful to see the whole routine where your embed code occurs. I suspect it's
Validate::CAR:Model  routine

Seeing the embed in context will help explain what's going on.

Cheers
Bruce

Mike Grigsby

  • Sr. Member
  • ****
  • Posts: 380
    • Yahoo Instant Messenger - onthedotsoftware
    • View Profile
    • MyHomeAssets! Software (among others)
Re: Field value filling another field
« Reply #2 on: September 16, 2008, 11:07:18 PM »
Thanks Bruce. The exact code is now:

 p_web.SetSessionValue('PRD:Keywords',p_web.GetSessionValue('PRD:Model'))


and still not working. A screen shot of the embed is attached.

[attachment deleted by admin]
Mike Grigsby
Credify Systems
Central Oregon, USA

Mike Grigsby

  • Sr. Member
  • ****
  • Posts: 380
    • Yahoo Instant Messenger - onthedotsoftware
    • View Profile
    • MyHomeAssets! Software (among others)
Re: Field value filling another field
« Reply #3 on: September 16, 2008, 11:10:13 PM »
And here's the template area for the model field. I did try the new drop down to Validate Immediately, but that didn't seem to make a difference.

[attachment deleted by admin]
Mike Grigsby
Credify Systems
Central Oregon, USA

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: Field value filling another field
« Reply #4 on: September 16, 2008, 11:46:38 PM »
Dude !

That's not the code.
Right-click on the procedure, and choose "source".
Now use the button on the tool bar to skip down to your embed.

Now you can see the embed in Context. This is 100% the most important step you can make as a clarion programmer. If you don't look at the code in context you will NEVER really understand what is going on. This is not specific to this problem, or specific to nettalk, it is the most important thing for any clarion programmer to do whenever they are embedding code.
Capiche?  8)

So - make a screen shot of the whole _routine_ so we can see your specific embed code in context with the whole rest of the routine.

(Incidentally the rest of the routine will also show if you've made a mistake on the template.)

Cheers
Bruce

Mike Grigsby

  • Sr. Member
  • ****
  • Posts: 380
    • Yahoo Instant Messenger - onthedotsoftware
    • View Profile
    • MyHomeAssets! Software (among others)
Re: Field value filling another field
« Reply #5 on: September 17, 2008, 07:14:31 AM »
Ouch. I feel like a little school boy again.<g> Sorry, I know how to view the source, I didn't know what you needed though. Attached is the screen shot.

[attachment deleted by admin]
Mike Grigsby
Credify Systems
Central Oregon, USA

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: Field value filling another field
« Reply #6 on: September 17, 2008, 11:01:26 PM »
Hi Mike,

The code looks ok.

Is this server "live" somewhere where I can get to it?

My current guess is that there is something which renders the xml invalid. But I can see that easily if I browse to the page from here...

Failing that, the trick is to narrow down which of the routine calls below it is causing the problem. The easy way to test that is to duplicate them in your embed (all 4 of them) followed by a EXIT
Then you can comment them out one at a time to see which one is causing the problem. (My guess would be the call to do SendAlert )

Keep me posted.

Cheers
Bruce


Cheers
Bruce