NetTalk Central

Author Topic: How to refresh a field on a form  (Read 3423 times)

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
How to refresh a field on a form
« on: January 11, 2012, 03:14:59 PM »
As per the attached screen shot, I add invoice lines to the invoice. In the embed point GotFocusBack I calculate the Invoice totals by reading the relevant invoice lines, calculate discount etc.

The value returned is correct at that time.

However I cannot see how to refresh the Net, Tax And Gross fields on the form to show the new calculated values.

John

[attachment deleted by admin]

Devan

  • Full Member
  • ***
  • Posts: 230
    • View Profile
    • Email
Re: How to refresh a field on a form
« Reply #1 on: January 11, 2012, 06:15:50 PM »
John,

Try this - in your NetWebForm procedure in Clarion, go to the BrowseLineItems (or whatever it is called) field which calls the Browse for the line items on the form.

Go to the 'Client-Side' tab.  In the 'Refresh Other Fields' list box, click 'Insert' and choose the 'Nett' field, and ensure 'Value' is ticked.  Do the same for the other two fields you want refreshed.

I've done this successfully on normal entry fields, but not tried it on a Browse field.  Hopefully when the browse changes, it will trigger the other three fields below to force update.

Let me know how it goes!

Cheers,
Devan

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: How to refresh a field on a form
« Reply #2 on: January 12, 2012, 12:38:03 AM »
No sorry that does not work.

Looks like an examaple coming up for Bruce. Damn!

John

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: How to refresh a field on a form
« Reply #3 on: January 12, 2012, 02:28:44 AM »
Bruce - sorry about the quick throwing together of this.

Attached test3.zip. The aim is to go to an Invoice FORM, add invoice lines from the browse and REFRESH the invoice total.

To do that go to Browse/Invoice/Add. Give it a sequential number and leave the total blank. Now click Insert below to add a new invoice line. BUT I cannot find out why but the relationship is not working. So just type the Invoice ID in manually.

Now add an amount and save. The invoice form is now refreshed and the invoice line is shown. In the INVOICE embed (GotFocusBack) I total the invoice lines. I have checked that and at this stage it is correct. The invoice total has been calculated.

All I now want to do is refresh the INVOICE window to show that total.

In my code I update INV:Total and SSV('INV:Total',LOC:Amount) in case one was not working.

BTW The examples do not store the amounts in the records and are calculated at runtime. I cannot do that and must have the amounts held in the invoice record itself.

Thanks

John

[attachment deleted by admin]

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11186
    • View Profile
Re: How to refresh a field on a form
« Reply #4 on: January 13, 2012, 04:11:57 AM »
you were so close, just lost your confidence at the last second.
just add one more line to your existing update code (in gotFocusBack routine)

do Refresh::Inv:Total

you calc'd it correctly, and updated the memory session variable correctly, but you need to then "reset" the field in the browser.
and that's done with the Refresh::fieldname routine.

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: How to refresh a field on a form
« Reply #5 on: January 13, 2012, 04:18:20 AM »
Thanks Bruce. I knew it was easy.

Cheers.

John

osquiabro

  • Hero Member
  • *****
  • Posts: 677
    • View Profile
    • Email
Re: How to refresh a field on a form
« Reply #6 on: December 24, 2012, 07:36:59 AM »
this work for insert and update but not for delete..

osquiabro

  • Hero Member
  • *****
  • Posts: 677
    • View Profile
    • Email
Re: How to refresh a field on a form
« Reply #7 on: December 27, 2012, 04:41:05 AM »
somebody resolved the delete issue and refresh?? :'( :'( :'( >:(