NetTalk Central

Author Topic: Resetting children of a Netwebform (eg fields, browses, droplists)  (Read 3839 times)

hilton

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
Hi folks,

I have a number of items (browses, fields, droplist etc) in a Netwebform. One of them is a browse of Purchase Order Headers where the Status field is EIP.  If the status is set from 'Pending' to 'Released', it is disappears from the browse due to the filter and the fact that the Browse is Reset in the EIP options (this is good). However, an associated field and the PO Lines Browse do not reset even though they have been set as Reset items in the Header Browse.  I was wondering how I could do it manually in an embed.  Put another way when the status of the Header is changed from 'Pending' to 'Released' I want an embed to force the field and PO Line browse to reset.

Thank you in advance.

Hilton.

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Resetting children of a Netwebform (eg fields, browses, droplists)
« Reply #1 on: October 13, 2010, 04:09:14 PM »
I think this is what you are after. Value will be the equate of the browse rather than the procedure name.

   do Value::PRTimecardEntryBrowse  !1

hilton

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
Re: Resetting children of a Netwebform (eg fields, browses, droplists)
« Reply #2 on: October 14, 2010, 03:29:33 AM »
Hi Kevin,

That was an interesting suggestion and because of it I have learned more - thanks.  However, it is not the answer.  What happens is that the Header from the browse in question (the one that has been set to 'Released') disappears from the browse as it no longer conforms to the filter (which only considers 'Pending' orders) and it's related lines in the Lines browse remain unless the user clicks on another line in the Header browse.  I will continue fossiking - that's how we learn 'aint it.

Anyway, thank you very much for your interest.  I have just realised that I sat next to you in the Web course in Melbourne, hope your project is well.

Bye,
Hilton.

hilton

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
Re: Resetting children of a Netwebform (eg fields, browses, droplists)
« Reply #3 on: October 17, 2010, 08:14:59 PM »
Hi,

Just in case anyone was following this item, I solved the problem as follows:

1) Changed the Purchase Order Header browse to no longer allow updating of the status using eip
2) Changed the Purchase Order Header update form by removing the status as a field to change
3) Added a Release button to the Parent Netwebform that hosts all other objects(forms,browses etc)
4)Made the Purchase Order Header browse, the selected purchase order field and the Purchase Order Line Browse subject to the ClientSide Reset of the Added Button.
5) Wrote a function that changes the status when the button is pressed.

The net result is:
1) when you click on the Header Browse, the selected Purchase Order Field is updated and the Lines for the Purchase order appear in the related browse.
2) when you click the button to Release a Purchase Order a) it disappears off the Header Browse (due to filtering) b) the Selected Purchase Order Field is set to zero and c) The Purchase Order lines Browse is reset and no lines are shown (before the lines would hang around until you clicked on another Header).

Bye,
Hilton.

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Resetting children of a Netwebform (eg fields, browses, droplists)
« Reply #4 on: October 18, 2010, 03:17:04 AM »
Hi Hilton,

Yes, how are you? I'm waiting for Bruce to add some more functionality into the Popups so I can finish that project although I have long list of other stuff to fix/add in the meantime.

Interestingly my first web app was a PO system. I've just given it a bit of an update with some of the new NT5 features and added some new functionality so it is easier for users and administrators to work across more than one DB without logging out and back in again.

Sounds like you got your app working but what I use is the following embed and code as an alternative. I'd love to take credit but Bruce gave me the tip at one of his world wide capesoft training seminars. GetValue('ApproveButton') is the name of the button.

  ! Start of "After Setting Browse Behavior Settings"
  ! [Priority 5000]
  ! stuff for buttons can go here
  !Approve an order

  If p_web.GetValue('ApproveButton') = 'approvebutton'
     add the code to update the PO value before the filter kicks in.
     all the resets etc are all done automatically.

Cheers,

Kev