Checking if a project exists

That's where the Try-Catch I mentioned comes in. Wrap it in up with that and
then handle the error yourself, create your new project or whatever you
like.

On Tue, Aug 23, 2011 at 8:55 AM, Ted Koch <tkoch77@...> wrote:

> **
>
>
> I tried this code in place of the other code I was using
>
> Dim oTrans_ProjectAdapter As ProjectAdapter = New
> ProjectAdapter(QuoteForm)
> oTrans_ProjectAdapter.BOConnect()
>
> Dim existsProject as boolean =
> oTrans_ProjectAdapter.GetByID(strProjectID)
> oTrans_ProjectAdapter.Dispose()
>
> This returns true for existsProject variable if the project exists, and
> also returns false if the project doesn't exist.
>
> But it never makes it past this part of code when debugging in Visual
> Studio,
> Dim existsProject as boolean = oTrans_ProjectAdapter.GetByID(strProjectID)
>
> It then goes down to the catch ex as exception and brings up a window
> saying Record not found.
>
> ________________________________
> From: Waffqle <waffqle@...>
> To: vantage@yahoogroups.com
> Sent: Tuesday, August 23, 2011 8:29 AM
> Subject: Re: [Vantage] Checking if a project exists
>
>
> Do a GetByID and wrap it in a Try-Catch instead.
>
> On Tue, Aug 23, 2011 at 8:14 AM, tkoch77 <tkoch77@...> wrote:
>
> > **
> >
> >
> > I am trying to check if a project exists with some code on the Quote
> Entry
> > form. I use the CheckProjectID(projectID) method of the Quote Adapter,
> and I
> > am storing a boolean (true if it exists, false if it doesn't) to
> determine
> > what my code will perform next. This almost works how I want it to,
> except
> > if it encounters a project ID that doesn't exist it will pop up an Epicor
> > window telling me the Project ID is not valid, which I don't want because
> it
> > messes up the flow of the application. Does anyone know how I might
> suppress
> > this message Epicor is displaying, or a workaround to check for a project
> > ID? Here is the code I am currently using. Thanks.
> >
> > Dim strProjectID as String
> >
> > strProjectID = InputBox("Enter a Project ID", "Input Required")
> >
> > Dim oTrans_QuoteAdapter As QuoteAdapter
> > oTrans_QuoteAdapter = DirectCast(csm.TransAdaptersHT("oTrans_adapter"),
> > QuoteAdapter)
> >
> > Dim existsProject As Boolean =
> > oTrans_QuoteAdapter.CheckProjectID(strProjectID)
> >
> >
> >
>
> --
> *Waffqle Driggers*
>
> *High End Dev, System Design, Profit Drinking
> *
> *:: 904.962.2887*
> *:: waffqle@...*
> *:: NO FAXES*
>
> *
>
> *
>
> [Non-text portions of this message have been removed]
>
> ------------------------------------
>
>
> Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must have
> already linked your email address to a yahoo id to enable access. )
> (1) To access the Files Section of our Yahoo!Group for Report Builder and
> Crystal Reports and other 'goodies', please goto:
> http://groups.yahoo.com/group/vantage/files/.
> (2) To search through old msg's goto:
> http://groups.yahoo.com/group/vantage/messages
> (3) To view links to Vendors that provide Vantage services goto:
> http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links
>
> [Non-text portions of this message have been removed]
>
>
>



--
*Waffqle Driggers*
*High End Dev, System Design, Profit Drinking
*
*:: 904.962.2887*
*:: waffqle@...*
*:: NO FAXES*

*

*


[Non-text portions of this message have been removed]
I am trying to check if a project exists with some code on the Quote Entry form. I use the CheckProjectID(projectID) method of the Quote Adapter, and I am storing a boolean (true if it exists, false if it doesn't) to determine what my code will perform next. This almost works how I want it to, except if it encounters a project ID that doesn't exist it will pop up an Epicor window telling me the Project ID is not valid, which I don't want because it messes up the flow of the application. Does anyone know how I might suppress this message Epicor is displaying, or a workaround to check for a project ID? Here is the code I am currently using. Thanks.

Dim strProjectID as String

strProjectID = InputBox("Enter a Project ID", "Input Required")

Dim oTrans_QuoteAdapter As QuoteAdapter
oTrans_QuoteAdapter = DirectCast(csm.TransAdaptersHT("oTrans_adapter"), QuoteAdapter)


Dim existsProject As Boolean = oTrans_QuoteAdapter.CheckProjectID(strProjectID)
Do a GetByID and wrap it in a Try-Catch instead.

On Tue, Aug 23, 2011 at 8:14 AM, tkoch77 <tkoch77@...> wrote:

> **
>
>
> I am trying to check if a project exists with some code on the Quote Entry
> form. I use the CheckProjectID(projectID) method of the Quote Adapter, and I
> am storing a boolean (true if it exists, false if it doesn't) to determine
> what my code will perform next. This almost works how I want it to, except
> if it encounters a project ID that doesn't exist it will pop up an Epicor
> window telling me the Project ID is not valid, which I don't want because it
> messes up the flow of the application. Does anyone know how I might suppress
> this message Epicor is displaying, or a workaround to check for a project
> ID? Here is the code I am currently using. Thanks.
>
> Dim strProjectID as String
>
> strProjectID = InputBox("Enter a Project ID", "Input Required")
>
> Dim oTrans_QuoteAdapter As QuoteAdapter
> oTrans_QuoteAdapter = DirectCast(csm.TransAdaptersHT("oTrans_adapter"),
> QuoteAdapter)
>
> Dim existsProject As Boolean =
> oTrans_QuoteAdapter.CheckProjectID(strProjectID)
>
>
>



--
*Waffqle Driggers*
*High End Dev, System Design, Profit Drinking
*
*:: 904.962.2887*
*:: waffqle@...*
*:: NO FAXES*

*

*


[Non-text portions of this message have been removed]
I tried this code in place of the other code I was using

   Dim oTrans_ProjectAdapter As ProjectAdapter = New ProjectAdapter(QuoteForm)
   oTrans_ProjectAdapter.BOConnect()
  Â
   Dim existsProject as boolean = oTrans_ProjectAdapter.GetByID(strProjectID)
   oTrans_ProjectAdapter.Dispose()

This returns true for existsProject variable if the project exists, and also returns false if the project doesn't exist.

But it never makes it past this part of code when debugging in Visual Studio,
Dim existsProject as boolean = oTrans_ProjectAdapter.GetByID(strProjectID)

It then goes down to the catch ex as exception and brings up a window saying Record not found.






________________________________
From: Waffqle <waffqle@...>
To: vantage@yahoogroups.com
Sent: Tuesday, August 23, 2011 8:29 AM
Subject: Re: [Vantage] Checking if a project exists

Do a GetByID and wrap it in a Try-Catch instead.

On Tue, Aug 23, 2011 at 8:14 AM, tkoch77 <tkoch77@...> wrote:

> **
>
>
> I am trying to check if a project exists with some code on the Quote Entry
> form. I use the CheckProjectID(projectID) method of the Quote Adapter, and I
> am storing a boolean (true if it exists, false if it doesn't) to determine
> what my code will perform next. This almost works how I want it to, except
> if it encounters a project ID that doesn't exist it will pop up an Epicor
> window telling me the Project ID is not valid, which I don't want because it
> messes up the flow of the application. Does anyone know how I might suppress
> this message Epicor is displaying, or a workaround to check for a project
> ID? Here is the code I am currently using. Thanks.
>
> Dim strProjectID as String
>
> strProjectID = InputBox("Enter a Project ID", "Input Required")
>
> Dim oTrans_QuoteAdapter As QuoteAdapter
> oTrans_QuoteAdapter = DirectCast(csm.TransAdaptersHT("oTrans_adapter"),
> QuoteAdapter)
>
> Dim existsProject As Boolean =
> oTrans_QuoteAdapter.CheckProjectID(strProjectID)
>

>



--
*Waffqle Driggers*
*High End Dev, System Design, Profit Drinking
*
*:: 904.962.2887*
*:: waffqle@...*
*:: NO FAXES*

*

*


[Non-text portions of this message have been removed]



------------------------------------

Useful links for the Yahoo!Groups Vantage Board are: ( Note:Â You must have already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and Crystal Reports and other 'goodies', please goto: http://groups.yahoo.com/group/vantage/files/.%c2%a0
(2) To search through old msg's goto: http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto: http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links



[Non-text portions of this message have been removed]