NetTalk Central

Author Topic: How to Force Refresh of a Line in a Browse  (Read 4167 times)

Johan de Klerk

  • Full Member
  • ***
  • Posts: 214
  • Johan de Klerk
    • View Profile
    • Designer Software
How to Force Refresh of a Line in a Browse
« on: September 04, 2019, 09:29:15 PM »
Hi Bruce,

I have a Customer Browse (popup).
I have a Inline Button, this Button calls a Browse, InvoiceList, (as popup) with a list of Outstanding Invoices.
The customer clicks on a invoice and a popup form opens to allow for payment.
In the PostUpdate of the form I update the customers outstanding balance.
When closing the InvoiceList browse I need to refresh the customer line to show the updated outstanding balance.
At this stage you need to close and then open the Customer Browse to see the new outstanding balance.

How would I do this?
What command do I need to use?
In which embed do I put the code?

Regards

Johan de Klerk
Clarion 10, NT 11.57

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11176
    • View Profile
Re: How to Force Refresh of a Line in a Browse
« Reply #1 on: September 05, 2019, 12:28:36 AM »
the code would go in the FocusBack routine in the browse you want to refresh...

cheers
Bruce

Johan de Klerk

  • Full Member
  • ***
  • Posts: 214
  • Johan de Klerk
    • View Profile
    • Designer Software
Re: How to Force Refresh of a Line in a Browse
« Reply #2 on: September 05, 2019, 12:43:59 AM »
Hi Bruce,

Thanks.

What would be the code I put in there?

I only need to refresh the Cus:Outstand for this particular Customer.

Regards

Johan de Klerk
Clarion 10, NT 11.57

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11176
    • View Profile
Re: How to Force Refresh of a Line in a Browse
« Reply #3 on: September 05, 2019, 05:58:07 PM »
to just do 1 row is something like;

  do OpenFilesB
  If p_web.sqlsync then p_web.SqlWait(p_web.SqlName).
  p_web._LoadRecord(Countries,COU:key)
  open(thisview)
  p_web.LoadViewRecord(ThisView,Countries,COU:key)
  p_web.ViewToSessionQueue(ThisView)
  loc:InView = 1
  do BrowseRow
  loc:InView = 0
  do SendPacket
  Close(ThisView)
  If p_web.sqlsync then p_web.SqlRelease(p_web.SqlName).
  do ClosefilesB

cheers
Bruce

Johan de Klerk

  • Full Member
  • ***
  • Posts: 214
  • Johan de Klerk
    • View Profile
    • Designer Software
Re: How to Force Refresh of a Line in a Browse
« Reply #4 on: September 05, 2019, 09:37:58 PM »
Hi Bruce,

Thanks, will try.

I am not using SQL but TPS.
Is the SQL in your example used for TPS files as well?

Regards

Johan de Klerk
Clarion 10, NT 11.57

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11176
    • View Profile
Re: How to Force Refresh of a Line in a Browse
« Reply #5 on: September 07, 2019, 10:46:36 PM »
you can leave it in.

Johan de Klerk

  • Full Member
  • ***
  • Posts: 214
  • Johan de Klerk
    • View Profile
    • Designer Software
Re: How to Force Refresh of a Line in a Browse
« Reply #6 on: September 10, 2019, 05:08:49 AM »
Hi Bruce,

Back to this one.
I could not get your code to work, I can guarantee it is because I do something wrong and/or don't understand the concept.

Please see attached modified Books (71) Example App.

How to test it:
1) Open Customers
2) Click on "Test Update", it will open a "DummyInvoice" Browse
3) Click on "Change Cust Name" on any Row
4) It will show the current Customer Name
5) Change the name to something else
6) Click on Save
7) Click on Close on the "DummyInvoice" Browse
8) The Name is still the Old Name

The code on the "BrowseCustomers" in the GotFocusBack Embed is what I can't get to work to only refresh the details of this customer.

Please help.

Regards

Johan de Klerk
Clarion 10, NT 11.57

Johan de Klerk

  • Full Member
  • ***
  • Posts: 214
  • Johan de Klerk
    • View Profile
    • Designer Software
Re: How to Force Refresh of a Line in a Browse
« Reply #7 on: September 11, 2019, 06:14:57 AM »
Bruce,

Forgot to say.
You will notice I have code in the GotFocusBack that I butchered from template code.
It works but I think it is totally wrong.

Regards

Johan de Klerk
Clarion 10, NT 11.57

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11176
    • View Profile
Re: How to Force Refresh of a Line in a Browse
« Reply #8 on: September 11, 2019, 09:34:28 PM »
we can chat in the webinar.

cheers
Bruce

Johan de Klerk

  • Full Member
  • ***
  • Posts: 214
  • Johan de Klerk
    • View Profile
    • Designer Software
Re: How to Force Refresh of a Line in a Browse
« Reply #9 on: September 11, 2019, 09:37:26 PM »
100%
Clarion 10, NT 11.57