NetTalk Central

Author Topic: Update Parent Browse - Accounts Example web31  (Read 3401 times)

charl99

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • Email
Update Parent Browse - Accounts Example web31
« on: December 10, 2012, 02:09:45 AM »
Hi,

I have a similar Parent Browse -> Child Browse as per Invoices Browse in the above example.

When I update the Line Items Browse, I would like to update the Invoices Browse (the Total) as well.  This does not happen in the example, unless I press the Invoices Menu Item again (or indeed refresh in the browser in my case).  I have 'Other' Buttons on the Child Browse though.

I have tried this:

  ! End of "After Validate New Value"
  Loc:Eip = 0
  do CallBrowse
  ! Start of "After Data Refreshed"
  ! [Priority 5000]
 
    p_web.setValue('_ParentProc','')           ! Next 3 lines my Code which I saw in the web31 example, but this does not work
    p_web.DeleteValue('_EIPClm')         
    WBrowseNewSections(p_web)
   
  ! End of "After Data Refreshed"

Please, how can I do this?

Thanks

Charl
« Last Edit: December 10, 2012, 06:35:47 AM by charl99 »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11191
    • View Profile
Re: Update Parent Browse - Accounts Example web31
« Reply #1 on: December 11, 2012, 12:09:15 AM »
Hi Charl,

>> This does not happen in the example

that's an interesting starting point, because in my test here, with that example, if I change something in the child, that changes the total, then the change is reflected in the parent.

As you noted in your post, the change is caused by the 3 lines;

  p_web.setValue('_ParentProc_','')
  p_web.DeleteValue('_EIPClm_')
  BrowseInvoices(p_web)


which are in the Validate::LIN:Quantity and Validate::LIN:Price routines.


cheers
Bruce

charl99

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • Email
Re: Update Parent Browse - Accounts Example web31
« Reply #2 on: December 11, 2012, 02:03:56 AM »
Bruce, Yep, interesting indeed. 

Silly me did not notice the 'Paid' thing in the Invoices Browse, which means I could not do the EIP on the 1st Invoice, so I tried Change Line Item...

Please let me rephrase then:

I am calling a Pop-Up Memory Form from my equivalent of a row in the 'Line Items', which either (a) Change the Row, or (b) Add a New Row.

For (a) Change a Row - I Refresh in the Line Items the Browse Row Data and
for (b) Add a New Row, I Refresh the whole Line Items Browse.

I guess I cannot figure out the right     p_web.DeleteValue('_EIPClm_')     to use, it kind of looks wrong, I saw a _Pop-Up_ thing in the code.
I cannot figure out the right routine to place the code.

Thanks
Charl

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11191
    • View Profile
Re: Update Parent Browse - Accounts Example web31
« Reply #3 on: December 11, 2012, 03:31:51 AM »
I think you will need to tweak an example and post here to show what you are doing Charl.

cheers
Bruce

charl99

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • Email
Re: Update Parent Browse - Accounts Example web31
« Reply #4 on: December 11, 2012, 06:59:16 AM »
Bruce, sure, NOT always easy to tweak an example by the way!

Anyway, Account example 31 tweaked. Note:

1. Added Total field to Invoice.tps and don't do calculation in Invoices Browse, file field now.
2. Added 2 Buttons to Line Items Browse -> that goes to a Memory Form
3. One Edit button, that refreshes Browse Row, Other Insert Button that refreshes whole Browse
4. When I do something here, and Save changes, I update Invoices file total

Nevermind what I've tried, I cannot find the right place to put embed code to update the Invoices Browse (so I did not even try with the example).  So I guess, if you can please add the 6 lines of code at the right place I will probably be able to go away for Christmas.

Thanks a million

Charl





[attachment deleted by admin]

charl99

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • Email
Re: Update Parent Browse - Accounts Example web31
« Reply #5 on: December 16, 2012, 12:44:19 AM »
Hi Bruce,

Good thing I postponed my 5 days holiday for 4 days.

Any news on this?

Thanks

Charl

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11191
    • View Profile
Re: Update Parent Browse - Accounts Example web31
« Reply #6 on: December 16, 2012, 10:52:35 PM »
Hi Charl,

I think you posted the wrong app. The attached app did not have;

>> 2. Added 2 Buttons to Line Items Browse -> that goes to a Memory Form

also no code for

>> 4. When I do something here, and Save changes, I update Invoices file total

so I think you need to repost.

cheers
Bruce

charl99

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • Email
Re: Update Parent Browse - Accounts Example web31
« Reply #7 on: December 18, 2012, 02:50:11 AM »
Bruce,

Yes, sorry for wasting time, that was the old habit of just going to the CapeSoft folder in Clarion 8.  ???

Anyway, I made sure this time!

Thanks
Charl

[attachment deleted by admin]

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11191
    • View Profile
Re: Update Parent Browse - Accounts Example web31
« Reply #8 on: December 18, 2012, 05:40:29 AM »
In the ValidateRecord routine,
after your embed code, add

  p_web.setValue('_ParentProc_','')
  p_web.DeleteValue('_EIPClm_')
  BrowseInvoices(p_web)


Cheers
Bruce

charl99

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • Email
Re: Update Parent Browse - Accounts Example web31
« Reply #9 on: December 19, 2012, 05:43:21 AM »
Bruce,

You are BRILLIANT!

Danke Schoen

Charl