NetTalk Central

Author Topic: Got focus back  (Read 3718 times)

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Got focus back
« on: December 28, 2011, 07:22:11 AM »
I have an invoice form with a nett total on it. Beneath are the child invoice lines in a browse. I create an invoice line then on the invoice form itself in the embed point Got Focus Back at the End I loop through the invoice lines, total them up and calculate the invoice totals.

This works just fine in that I have variables holding the correct totals. However I cannot assign them to the invoice record itself.

So I have the invoice showing as a form and want to refresh the totals.

How do i do that? I tried saying inv:nett = loc:nett and p_web.ssv('inv:nett',loc:nett) but nothing seems to assign the values. Yet the local variables are there and correct.

Thank you

John

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Got focus back
« Reply #1 on: December 28, 2011, 07:38:50 AM »
Not sure that you should be using the "got Focus Back" embed for this - but nevertheless it falls into the category of "post an example" - it's impossible to comment on embed code from the description alone.

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: Got focus back
« Reply #2 on: December 28, 2011, 09:49:53 AM »
OK thanks. Which embed should be used? Maybe if I use the right one it will work and if not will post an example.

I had thought I could use totalling but I thnk that is only on a  browse.

Basically invoice header form, add child invoice lines and I want to total up the invoice lines and put the total in the header record. Hope that makes sense.

Thanks

John

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: Got focus back
« Reply #3 on: December 29, 2011, 09:14:02 AM »
Bruce - if you use that example I sent this morning and go to View Invoice/Insert you will see the BrowseLines at the bottom. Add a Line record and then save. You will how I am trying to update the total of invoice lines on the main invoice record.

The code is in GotFocusBack of the invoice form. See how I tried two ways of updating the record, direct and using session variables.

It might be I have to consider another way of doing it.

BTW these forms have not had much done to them so not everything is working at all. But it should still allow me to total.

HTH

Thanks

John

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Got focus back
« Reply #4 on: December 30, 2011, 06:12:03 AM »
that example doesn't compile here because it has a definition;
ITD  ITDateClass

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: Got focus back
« Reply #5 on: December 30, 2011, 07:01:32 AM »
Oh sorry. That's IceTips.

Can you not see the code I am referring to or do you need a compiled example?

Thanks

john