On Error Resume Next - question

thanks again!

Kunal



----- Original Message ----
From: Robert Brown <robertb_versa@...>
To: vantage@yahoogroups.com
Sent: Friday, May 16, 2008 3:59:41 PM
Subject: Re: [Vantage] Re: On Error Resume Next - question


Another trick that works is to set a custom epiTextBox = edvPODetail. dataView( edvPODetail. Row)("PONum" ))

Calling it txtEpiCustPONum, your code is then:

Private Sub txtEpiCustPONum_ ValueChanged( ByVal Sender As Object, ByVal Args As System.EventArgs) Handles txtEpiCrelQty. ValueChanged

If len(txtEpiCustPONum .text) <> 0 then
'//** If in an app like PO Entry where no editing can occur
'//** unless PO is unapproved,
'//** also test POHeader.ApprovalSt atus
If edvPOHdr.dataView( edvPOHdr. Row)("ApprovalSt atus") = "U" then
'//** Do your stuff **
end if
End If
End Sub

This works when epiNotifications are unreliable for the app being modified & when after_adaptermethod triggers don't exist that are appropriate.

Rob Brown

--- On Fri, 5/16/08, bw2868bond <bwalker@adcocircuit s.com> wrote:

From: bw2868bond <bwalker@adcocircuit s.com>
Subject: [Vantage] Re: On Error Resume Next - question
To: vantage@yahoogroups .com
Date: Friday, May 16, 2008, 1:45 PM

In the properties window for the button - make the enabled property
False

when you detect that you have a PONum (like watch the dataview
initialize event and when the row count is not -1) set the property
to true (btnClickMe. Enabled = True) - you will have to also set it
back to false when the PONum is not valid

Just a thought - there are many ways to accomplish preventing the
error.

--- In vantage@yahoogroups .com, Kunal Ganguly <kunal_vantage@ ...>
wrote:
>
> >
> Keep the button not enabled until there is a valid PONum ?
>
> How would I do that? Is that some setting in the customizations
interface?
>
> Thanks,
> Kunal
>
>
>
> ----- Original Message ----
> From: bw2868bond <bwalker@... >
> To: vantage@yahoogroups .com
> Sent: Friday, May 16, 2008 12:24:25 PM
> Subject: [Vantage] Re: On Error Resume Next - question
>
>
> --- In vantage@yahoogroups .com, "Mark Wonsil" <mark_wonsil@ ...>
wrote:
> >
> > > Here is my code for a button event in the PO entry form, it
> essentially
> > > launches an external app I wrote in VB which looks up some
stuff in
> a SQL DB
> > > separate from vantage, but it needs data from this form -
> >
> > Would testing for a null entry work?
> >
> > If Not IsNull(edvPODetail. dataView( edvPODetail. Row)("PONum" ))
then
> > process.start( "c:\engdrawdatav 2.exe",
> > edvPODetail. dataView( edvPODetail. Row)("PONum" ))
> > end if
> >
> > Mark W.
> >
>
> Keep the button not enabled until there is a valid PONum ?
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>






[Non-text portions of this message have been removed]
This may already have been answered in another form the past, so please forgive me for the repetition.


Here is my code for a button event in the PO entry form, it essentially launches an external app I wrote in VB which looks up some stuff in a SQL DB separate from vantage, but it needs data from this form -

Private Sub btnASHLookupDrawings_Click(ByVal Sender As Object, ByVal Args As System.EventArgs) Handles btnASHLookupDrawings.Click
'// ** Place Event Handling Code Here **

On Error Resume Next
Dim edvPODetail As EpiDataView = CType(oTrans.EpiDataViews("PODetail"), EpiDataView)
Dim userPONum as String = edvPODetail.dataView(edvPODetail.Row)("PONum")

process.start("c:\engdrawdatav2.exe", edvPODetail.dataView(edvPODetail.Row)("PONum"))

End Sub

I need the "On Error Resume Next" because if the user accidentally clicks the button when no PO is loaded, then a nasty exception message is generated because the EpiDataView has nothing to reference to. Is there a more graceful way of doing this. I realize that a Try .. Catch might work, but would it not be more of less the same thing?

Thanks,
Kunal





[Non-text portions of this message have been removed]
> Here is my code for a button event in the PO entry form, it essentially
> launches an external app I wrote in VB which looks up some stuff in a SQL DB
> separate from vantage, but it needs data from this form -

Would testing for a null entry work?

If Not IsNull(edvPODetail.dataView(edvPODetail.Row)("PONum")) then
process.start("c:\engdrawdatav2.exe",
edvPODetail.dataView(edvPODetail.Row)("PONum"))
end if

Mark W.
--- In vantage@yahoogroups.com, "Mark Wonsil" <mark_wonsil@...> wrote:
>
> > Here is my code for a button event in the PO entry form, it
essentially
> > launches an external app I wrote in VB which looks up some stuff in
a SQL DB
> > separate from vantage, but it needs data from this form -
>
> Would testing for a null entry work?
>
> If Not IsNull(edvPODetail.dataView(edvPODetail.Row)("PONum")) then
> process.start("c:\engdrawdatav2.exe",
> edvPODetail.dataView(edvPODetail.Row)("PONum"))
> end if
>
> Mark W.
>

Keep the button not enabled until there is a valid PONum ?
>
Keep the button not enabled until there is a valid PONum ?

How would I do that? Is that some setting in the customizations interface?

Thanks,
Kunal



----- Original Message ----
From: bw2868bond <bwalker@...>
To: vantage@yahoogroups.com
Sent: Friday, May 16, 2008 12:24:25 PM
Subject: [Vantage] Re: On Error Resume Next - question


--- In vantage@yahoogroups .com, "Mark Wonsil" <mark_wonsil@ ...> wrote:
>
> > Here is my code for a button event in the PO entry form, it
essentially
> > launches an external app I wrote in VB which looks up some stuff in
a SQL DB
> > separate from vantage, but it needs data from this form -
>
> Would testing for a null entry work?
>
> If Not IsNull(edvPODetail. dataView( edvPODetail. Row)("PONum" )) then
> process.start( "c:\engdrawdatav 2.exe",
> edvPODetail. dataView( edvPODetail. Row)("PONum" ))
> end if
>
> Mark W.
>

Keep the button not enabled until there is a valid PONum ?






[Non-text portions of this message have been removed]
In the properties window for the button - make the enabled property
False

when you detect that you have a PONum (like watch the dataview
initialize event and when the row count is not -1) set the property
to true (btnClickMe.Enabled = True) - you will have to also set it
back to false when the PONum is not valid

Just a thought - there are many ways to accomplish preventing the
error.

--- In vantage@yahoogroups.com, Kunal Ganguly <kunal_vantage@...>
wrote:
>
> >
> Keep the button not enabled until there is a valid PONum ?
>
> How would I do that? Is that some setting in the customizations
interface?
>
> Thanks,
> Kunal
>
>
>
> ----- Original Message ----
> From: bw2868bond <bwalker@...>
> To: vantage@yahoogroups.com
> Sent: Friday, May 16, 2008 12:24:25 PM
> Subject: [Vantage] Re: On Error Resume Next - question
>
>
> --- In vantage@yahoogroups .com, "Mark Wonsil" <mark_wonsil@ ...>
wrote:
> >
> > > Here is my code for a button event in the PO entry form, it
> essentially
> > > launches an external app I wrote in VB which looks up some
stuff in
> a SQL DB
> > > separate from vantage, but it needs data from this form -
> >
> > Would testing for a null entry work?
> >
> > If Not IsNull(edvPODetail. dataView( edvPODetail. Row)("PONum" ))
then
> > process.start( "c:\engdrawdatav 2.exe",
> > edvPODetail. dataView( edvPODetail. Row)("PONum" ))
> > end if
> >
> > Mark W.
> >
>
> Keep the button not enabled until there is a valid PONum ?
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
That really helps! Thank You!!


Kunal



----- Original Message ----
From: bw2868bond <bwalker@...>
To: vantage@yahoogroups.com
Sent: Friday, May 16, 2008 12:45:47 PM
Subject: [Vantage] Re: On Error Resume Next - question


In the properties window for the button - make the enabled property
False

when you detect that you have a PONum (like watch the dataview
initialize event and when the row count is not -1) set the property
to true (btnClickMe. Enabled = True) - you will have to also set it
back to false when the PONum is not valid

Just a thought - there are many ways to accomplish preventing the
error.

--- In vantage@yahoogroups .com, Kunal Ganguly <kunal_vantage@ ...>
wrote:
>
> >
> Keep the button not enabled until there is a valid PONum ?
>
> How would I do that? Is that some setting in the customizations
interface?
>
> Thanks,
> Kunal
>
>
>
> ----- Original Message ----
> From: bw2868bond <bwalker@... >
> To: vantage@yahoogroups .com
> Sent: Friday, May 16, 2008 12:24:25 PM
> Subject: [Vantage] Re: On Error Resume Next - question
>
>
> --- In vantage@yahoogroups .com, "Mark Wonsil" <mark_wonsil@ ...>
wrote:
> >
> > > Here is my code for a button event in the PO entry form, it
> essentially
> > > launches an external app I wrote in VB which looks up some
stuff in
> a SQL DB
> > > separate from vantage, but it needs data from this form -
> >
> > Would testing for a null entry work?
> >
> > If Not IsNull(edvPODetail. dataView( edvPODetail. Row)("PONum" ))
then
> > process.start( "c:\engdrawdatav 2.exe",
> > edvPODetail. dataView( edvPODetail. Row)("PONum" ))
> > end if
> >
> > Mark W.
> >
>
> Keep the button not enabled until there is a valid PONum ?
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>






[Non-text portions of this message have been removed]
Another trick that works is to set a custom epiTextBox = edvPODetail. dataView( edvPODetail. Row)("PONum" ))

Calling it txtEpiCustPONum, your code is then:

Private Sub txtEpiCustPONum_ValueChanged(ByVal Sender As Object, ByVal Args As System.EventArgs) Handles txtEpiCrelQty.ValueChanged

If len(txtEpiCustPONum.text) <> 0 then
'//** If in an app like PO Entry where no editing can occur
'//** unless PO is unapproved,
'//** also test POHeader.ApprovalStatus
If edvPOHdr.dataView(edvPOHdr.Row)("ApprovalStatus") = "U" then
'//** Do your stuff **
end if
End If
End Sub

This works when epiNotifications are unreliable for the app being modified & when after_adaptermethod triggers don't exist that are appropriate.

Rob Brown

--- On Fri, 5/16/08, bw2868bond <bwalker@...> wrote:

From: bw2868bond <bwalker@...>
Subject: [Vantage] Re: On Error Resume Next - question
To: vantage@yahoogroups.com
Date: Friday, May 16, 2008, 1:45 PM






In the properties window for the button - make the enabled property
False

when you detect that you have a PONum (like watch the dataview
initialize event and when the row count is not -1) set the property
to true (btnClickMe. Enabled = True) - you will have to also set it
back to false when the PONum is not valid

Just a thought - there are many ways to accomplish preventing the
error.

--- In vantage@yahoogroups .com, Kunal Ganguly <kunal_vantage@ ...>
wrote:
>
> >
> Keep the button not enabled until there is a valid PONum ?
>
> How would I do that? Is that some setting in the customizations
interface?
>
> Thanks,
> Kunal
>
>
>
> ----- Original Message ----
> From: bw2868bond <bwalker@... >
> To: vantage@yahoogroups .com
> Sent: Friday, May 16, 2008 12:24:25 PM
> Subject: [Vantage] Re: On Error Resume Next - question
>
>
> --- In vantage@yahoogroups .com, "Mark Wonsil" <mark_wonsil@ ...>
wrote:
> >
> > > Here is my code for a button event in the PO entry form, it
> essentially
> > > launches an external app I wrote in VB which looks up some
stuff in
> a SQL DB
> > > separate from vantage, but it needs data from this form -
> >
> > Would testing for a null entry work?
> >
> > If Not IsNull(edvPODetail. dataView( edvPODetail. Row)("PONum" ))
then
> > process.start( "c:\engdrawdatav 2.exe",
> > edvPODetail. dataView( edvPODetail. Row)("PONum" ))
> > end if
> >
> > Mark W.
> >
>
> Keep the button not enabled until there is a valid PONum ?
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>