VB Code help - referring to a Foreign Key

Never tried it on a ud field... Interesting idea.
If you try it (and it works) let us know... it sure does open up some easy ways to fill in some holes in Vantage (sans code - all the better!)
Rob
--- Original Message ---
From:"Brian W. Spolarich " <bspolarich@...>
Sent:Fri 5/15/09 9:18 am
To:<vantage@yahoogroups.com>
Subj:RE: [Vantage] Re: VB Code help - referring to a Foreign Key

Could this could be a solution for the perennial question of "how do I inactivate a PartBin"? Define PartBin.Checkbox01 (or whatever) to signify "inactive" and use this to filter.

-bws

--
Brian W. Spolarich ~ Manager, Information Services ~ Advanced Photonix / Picometrix
    bspolarich@... ~ 734-864-5618 ~ www.advancedphotonix.com


-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Robert Brown
Sent: Thursday, May 14, 2009 4:38 PM
To: vantage@yahoogroups.com
Subject: Re: [Vantage] Re: VB Code help - referring to a Foreign Key

The control has a BO method associated with it - In the case of Rev (for Part) - it is probably a GetByID method.

When you fill in this info (Approved=True), you are essentially passing GetByID() an additional search criteria argument.

Rob




________________________________
From: Brian W. Spolarich <bspolarich@...>
To: vantage@yahoogroups.com
Sent: Thursday, May 14, 2009 3:40:03 PM
Subject: RE: [Vantage] Re: VB Code help - referring to a Foreign Key





I'm not quite getting this. What does the SearchFilter property of a Vantage control do?

--
Brian W. Spolarich ~ Manager, Information Services ~ Advanced Photonix / Picometrix
    bspolarich@advanced photonix. com ~ 734-864-5618 ~ www.advancedphotoni x.com

-----Original Message-----
From: vantage@yahoogroups .com [mailto:vantage@yahoogroups .com] On Behalf Of Rob Bucek
Sent: Thursday, May 14, 2009 3:35 PM
To: vantage@yahoogroups .com
Subject: RE: [Vantage] Re: VB Code help - referring to a Foreign Key

That's a tidy little trick...where did you learn that? Are there other
fields that works well with?

Rob Bucek

Manufacturing Engineer

PH: 715-284-5376 ext 311

FAX: 715-284-4084

<http://www.dsmfg com/>

(Click the logo to view our site)

____________ _________ _________ __

From: vantage@yahoogroups .com [mailto:vantage@yahoogroups .com] On Behalf
Of Robert Brown
Sent: Thursday, May 14, 2009 2:02 PM
To: vantage@yahoogroups .com
Subject: Re: [Vantage] Re: VB Code help - referring to a Foreign Key

I think you guys are overcomplicating things.

Open sales order entry and go into customization.

Navigate to the Lines Tab & click on the part rev control.

In the properties window for that control (Datasource: OrderDtl,
Datafield: RevisionNumber) , look for a properties line called
"SearchFilter" . I'm betting the value is null.

Try entering (without the quotes) "Approved=True" and save the
customization.

Reopen sales entry & look at the same control. If the parameters you
entered (Approved=True) are still there - great: Just test the app with
a partnumber causing you entry problems (entry of an unapproved rev) and
verify the filtering has solved your problem.

If it hasn't, then you're back to hard coding a VB subroutine (as you
are doing below).

Most part rev entry fields are capable of having this parameter entered.

Rob

____________ _________ __
I am trying to validate that the Rev on a part is approved during order entry. I have customized the form to display a foreign key from the PartRev table.

I want to display an alert if the Rev is not approved. I'm not sure if I am going about this the best way, but here's what I am trying:

Private Sub OrderDtl_AfterFieldChange(ByVal sender As object, ByVal args As DataColumnChangeEventArgs) Handles OrderDtl_Column.ColumnChanged

'here I want to check to see if the PartRev is approved such as:
If args.Row("[Approved]") = False Then...

but this field is not part of the OrderDtl table. How can I refer to the field PartRev.Approved which is part of a foreign key?


End Sub

Also, I am a newbie at VB.Net but a long time VBA programmer. Where might I find good documentation that would help me answer questions like this.

thanks in advance,

Randy Weber
IT Manager
TLC Electronics
Randy,



You need to declare the partrev view as a variable i.e.



Dim edvPR As EpiDataView = CType(oTrans.EpiDataViews("PartRev"),
EpiDataView)



This will allow you to then declare individual fields within that
view...



Dim vAprv As Boolean = edvPR.dataView(edvPR.Row)("Approved")



Maybe that will help you get going in the right direction..let me know
if you need more..

Rob Bucek

Manufacturing Engineer

PH: 715-284-5376 ext 311

FAX: 715-284-4084

<http://www.dsmfg.com/>

(Click the logo to view our site)



________________________________

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Randy
Sent: Wednesday, May 13, 2009 11:26 AM
To: vantage@yahoogroups.com
Subject: [Vantage] VB Code help - referring to a Foreign Key





I am trying to validate that the Rev on a part is approved during order
entry. I have customized the form to display a foreign key from the
PartRev table.

I want to display an alert if the Rev is not approved. I'm not sure if I
am going about this the best way, but here's what I am trying:

Private Sub OrderDtl_AfterFieldChange(ByVal sender As object, ByVal args
As DataColumnChangeEventArgs) Handles OrderDtl_Column.ColumnChanged

'here I want to check to see if the PartRev is approved such as:
If args.Row("[Approved]") = False Then...

but this field is not part of the OrderDtl table. How can I refer to the
field PartRev.Approved which is part of a foreign key?

End Sub

Also, I am a newbie at VB.Net but a long time VBA programmer. Where
might I find good documentation that would help me answer questions like
this.

thanks in advance,

Randy Weber
IT Manager
TLC Electronics





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



Thanks for your help. I think I am close but I got an error: Error
Detail

============

Object reference not set to an instance of an object.





The error went away when I remmed out the second statement: Dim vAprv As
Boolean...



I placed the code inside my Private Sub OrderDtl_AfterFieldChange...



Is this the right location for both lines or do they have to be declared
elsewhere?



Randy Weber









From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Rob Bucek
Sent: Wednesday, May 13, 2009 11:42 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] VB Code help - referring to a Foreign Key








Randy,

You need to declare the partrev view as a variable i.e.

Dim edvPR As EpiDataView = CType(oTrans.EpiDataViews("PartRev"),
EpiDataView)

This will allow you to then declare individual fields within that
view...

Dim vAprv As Boolean = edvPR.dataView(edvPR.Row)("Approved")

Maybe that will help you get going in the right direction..let me know
if you need more..

Rob Bucek

Manufacturing Engineer

PH: 715-284-5376 ext 311

FAX: 715-284-4084

<http://www.dsmfg.com/>

(Click the logo to view our site)

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Randy
Sent: Wednesday, May 13, 2009 11:26 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: [Vantage] VB Code help - referring to a Foreign Key

I am trying to validate that the Rev on a part is approved during order
entry. I have customized the form to display a foreign key from the
PartRev table.

I want to display an alert if the Rev is not approved. I'm not sure if I
am going about this the best way, but here's what I am trying:

Private Sub OrderDtl_AfterFieldChange(ByVal sender As object, ByVal args
As DataColumnChangeEventArgs) Handles OrderDtl_Column.ColumnChanged

'here I want to check to see if the PartRev is approved such as:
If args.Row("[Approved]") = False Then...

but this field is not part of the OrderDtl table. How can I refer to the
field PartRev.Approved which is part of a foreign key?

End Sub

Also, I am a newbie at VB.Net but a long time VBA programmer. Where
might I find good documentation that would help me answer questions like
this.

thanks in advance,

Randy Weber
IT Manager
TLC Electronics

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





[Non-text portions of this message have been removed]
It should all be under your sub try:



If edvPR.dataView(edvPR.Row)("Approved") = False Then....



With those Boolean ones Im not sure if at times a 1 or 0 may be
appropriate as that is actually the value you will see in the tables
themselves.

Rob Bucek

Manufacturing Engineer

PH: 715-284-5376 ext 311

FAX: 715-284-4084

<http://www.dsmfg.com/>

(Click the logo to view our site)



________________________________

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Randy Weber
Sent: Wednesday, May 13, 2009 1:34 PM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] VB Code help - referring to a Foreign Key





Rob,

Thanks for your help. I think I am close but I got an error: Error
Detail

============

Object reference not set to an instance of an object.

The error went away when I remmed out the second statement: Dim vAprv As
Boolean...

I placed the code inside my Private Sub OrderDtl_AfterFieldChange...

Is this the right location for both lines or do they have to be declared
elsewhere?

Randy Weber

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Rob Bucek
Sent: Wednesday, May 13, 2009 11:42 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] VB Code help - referring to a Foreign Key

Randy,

You need to declare the partrev view as a variable i.e.

Dim edvPR As EpiDataView = CType(oTrans.EpiDataViews("PartRev"),
EpiDataView)

This will allow you to then declare individual fields within that
view...

Dim vAprv As Boolean = edvPR.dataView(edvPR.Row)("Approved")

Maybe that will help you get going in the right direction..let me know
if you need more..

Rob Bucek

Manufacturing Engineer

PH: 715-284-5376 ext 311

FAX: 715-284-4084

<http://www.dsmfg.com/ <http://www.dsmfg.com/> >

(Click the logo to view our site)

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Randy
Sent: Wednesday, May 13, 2009 11:26 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
Subject: [Vantage] VB Code help - referring to a Foreign Key

I am trying to validate that the Rev on a part is approved during order
entry. I have customized the form to display a foreign key from the
PartRev table.

I want to display an alert if the Rev is not approved. I'm not sure if I
am going about this the best way, but here's what I am trying:

Private Sub OrderDtl_AfterFieldChange(ByVal sender As object, ByVal args
As DataColumnChangeEventArgs) Handles OrderDtl_Column.ColumnChanged

'here I want to check to see if the PartRev is approved such as:
If args.Row("[Approved]") = False Then...

but this field is not part of the OrderDtl table. How can I refer to the
field PartRev.Approved which is part of a foreign key?

End Sub

Also, I am a newbie at VB.Net but a long time VBA programmer. Where
might I find good documentation that would help me answer questions like
this.

thanks in advance,

Randy Weber
IT Manager
TLC Electronics

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

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





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

I need to do exactly the same thing. I'm on 8.03.404.

Assuming that you can get this to work, would you be willing to share any part of it?

Lynn



--- In vantage@yahoogroups.com, "Randy" <rweber@...> wrote:
>
> I am trying to validate that the Rev on a part is approved during order entry. I have customized the form to display a foreign key from the PartRev table.
>
> I want to display an alert if the Rev is not approved. I'm not sure if I am going about this the best way, but here's what I am trying:
>
> Private Sub OrderDtl_AfterFieldChange(ByVal sender As object, ByVal args As DataColumnChangeEventArgs) Handles OrderDtl_Column.ColumnChanged
>
> 'here I want to check to see if the PartRev is approved such as:
> If args.Row("[Approved]") = False Then...
>
> but this field is not part of the OrderDtl table. How can I refer to the field PartRev.Approved which is part of a foreign key?
>
>
> End Sub
>
> Also, I am a newbie at VB.Net but a long time VBA programmer. Where might I find good documentation that would help me answer questions like this.
>
> thanks in advance,
>
> Randy Weber
> IT Manager
> TLC Electronics
>
Rob,



I got it - sort of. The problem was that I was referring to PartRev as
the ViewName when I should have been using the name of the foreign key I
created called 'Rev'. Below works, but with another issue.



'Rev is a Foreign Key I created tying OrderDtl.PartNum to the
PartRev table.

Dim edvPR As EpiDataView = CType(oTrans.EpiDataViews("Rev"),EpiDataView)

Dim vAprv As Boolean

vAprv = edvPR.dataView(edvPR.Row)("Approved")



My other issue is that what gets returned is the previous value as
opposed to the current value. For example:

Rev 2 is current on the order.

I change to Rev 1 - not Approved. Return value=true

I choose Rev 2 - Approved. Return value=false



I tried changing from BeforeFieldChange to AfterFieldChange and I get
the same result - it always returns the previous value. Any suggestions?



Randy









From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Rob Bucek
Sent: Wednesday, May 13, 2009 1:58 PM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] VB Code help - referring to a Foreign Key








It should all be under your sub try:

If edvPR.dataView(edvPR.Row)("Approved") = False Then....

With those Boolean ones Im not sure if at times a 1 or 0 may be
appropriate as that is actually the value you will see in the tables
themselves.

Rob Bucek

Manufacturing Engineer

PH: 715-284-5376 ext 311

FAX: 715-284-4084

<http://www.dsmfg.com/>

(Click the logo to view our site)

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Randy Weber
Sent: Wednesday, May 13, 2009 1:34 PM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] VB Code help - referring to a Foreign Key

Rob,

Thanks for your help. I think I am close but I got an error: Error
Detail

============

Object reference not set to an instance of an object.

The error went away when I remmed out the second statement: Dim vAprv As
Boolean...

I placed the code inside my Private Sub OrderDtl_AfterFieldChange...

Is this the right location for both lines or do they have to be declared
elsewhere?

Randy Weber

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Rob Bucek
Sent: Wednesday, May 13, 2009 11:42 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] VB Code help - referring to a Foreign Key

Randy,

You need to declare the partrev view as a variable i.e.

Dim edvPR As EpiDataView = CType(oTrans.EpiDataViews("PartRev"),
EpiDataView)

This will allow you to then declare individual fields within that
view...

Dim vAprv As Boolean = edvPR.dataView(edvPR.Row)("Approved")

Maybe that will help you get going in the right direction..let me know
if you need more..

Rob Bucek

Manufacturing Engineer

PH: 715-284-5376 ext 311

FAX: 715-284-4084

<http://www.dsmfg.com/ <http://www.dsmfg.com/> >

(Click the logo to view our site)

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Randy
Sent: Wednesday, May 13, 2009 11:26 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
Subject: [Vantage] VB Code help - referring to a Foreign Key

I am trying to validate that the Rev on a part is approved during order
entry. I have customized the form to display a foreign key from the
PartRev table.

I want to display an alert if the Rev is not approved. I'm not sure if I
am going about this the best way, but here's what I am trying:

Private Sub OrderDtl_AfterFieldChange(ByVal sender As object, ByVal args
As DataColumnChangeEventArgs) Handles OrderDtl_Column.ColumnChanged

'here I want to check to see if the PartRev is approved such as:
If args.Row("[Approved]") = False Then...

but this field is not part of the OrderDtl table. How can I refer to the
field PartRev.Approved which is part of a foreign key?

End Sub

Also, I am a newbie at VB.Net but a long time VBA programmer. Where
might I find good documentation that would help me answer questions like
this.

thanks in advance,

Randy Weber
IT Manager
TLC Electronics

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

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

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





[Non-text portions of this message have been removed]
My apologies Randy, when I gave that example I should have mentioned
that you need to modify that by the name given to your view. Perhaps I
could have saved you some time. Have you done any trace logging with
data changes to see what methods are being called? This might point you
to a more appropriate trigger for what you are trying to do.



If I struggle anywhere its usually finding an event on a particular form
that is good for what I'm trying to capture, change, or what have you.
Try setting up some message boxes with the variables you are trying to
get and see what methods are firing and what the value is at the time.



Course the more that I think about it, if it were me I'd be using a BPM
to do what you're trying to accomplish..



Rob Bucek

Manufacturing Engineer

PH: 715-284-5376 ext 311

FAX: 715-284-4084

<http://www.dsmfg.com/>

(Click the logo to view our site)



________________________________

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Randy Weber
Sent: Thursday, May 14, 2009 8:06 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] VB Code help - referring to a Foreign Key





Rob,

I got it - sort of. The problem was that I was referring to PartRev as
the ViewName when I should have been using the name of the foreign key I
created called 'Rev'. Below works, but with another issue.

'Rev is a Foreign Key I created tying OrderDtl.PartNum to the
PartRev table.

Dim edvPR As EpiDataView = CType(oTrans.EpiDataViews("Rev"),EpiDataView)

Dim vAprv As Boolean

vAprv = edvPR.dataView(edvPR.Row)("Approved")

My other issue is that what gets returned is the previous value as
opposed to the current value. For example:

Rev 2 is current on the order.

I change to Rev 1 - not Approved. Return value=true

I choose Rev 2 - Approved. Return value=false

I tried changing from BeforeFieldChange to AfterFieldChange and I get
the same result - it always returns the previous value. Any suggestions?

Randy

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Rob Bucek
Sent: Wednesday, May 13, 2009 1:58 PM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] VB Code help - referring to a Foreign Key

It should all be under your sub try:

If edvPR.dataView(edvPR.Row)("Approved") = False Then....

With those Boolean ones Im not sure if at times a 1 or 0 may be
appropriate as that is actually the value you will see in the tables
themselves.

Rob Bucek

Manufacturing Engineer

PH: 715-284-5376 ext 311

FAX: 715-284-4084

<http://www.dsmfg.com/ <http://www.dsmfg.com/> >

(Click the logo to view our site)

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Randy Weber
Sent: Wednesday, May 13, 2009 1:34 PM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] VB Code help - referring to a Foreign Key

Rob,

Thanks for your help. I think I am close but I got an error: Error
Detail

============

Object reference not set to an instance of an object.

The error went away when I remmed out the second statement: Dim vAprv As
Boolean...

I placed the code inside my Private Sub OrderDtl_AfterFieldChange...

Is this the right location for both lines or do they have to be declared
elsewhere?

Randy Weber

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Rob Bucek
Sent: Wednesday, May 13, 2009 11:42 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] VB Code help - referring to a Foreign Key

Randy,

You need to declare the partrev view as a variable i.e.

Dim edvPR As EpiDataView = CType(oTrans.EpiDataViews("PartRev"),
EpiDataView)

This will allow you to then declare individual fields within that
view...

Dim vAprv As Boolean = edvPR.dataView(edvPR.Row)("Approved")

Maybe that will help you get going in the right direction..let me know
if you need more..

Rob Bucek

Manufacturing Engineer

PH: 715-284-5376 ext 311

FAX: 715-284-4084

<http://www.dsmfg.com/ <http://www.dsmfg.com/> <http://www.dsmfg.com/
<http://www.dsmfg.com/> > >

(Click the logo to view our site)

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Randy
Sent: Wednesday, May 13, 2009 11:26 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
Subject: [Vantage] VB Code help - referring to a Foreign Key

I am trying to validate that the Rev on a part is approved during order
entry. I have customized the form to display a foreign key from the
PartRev table.

I want to display an alert if the Rev is not approved. I'm not sure if I
am going about this the best way, but here's what I am trying:

Private Sub OrderDtl_AfterFieldChange(ByVal sender As object, ByVal args
As DataColumnChangeEventArgs) Handles OrderDtl_Column.ColumnChanged

'here I want to check to see if the PartRev is approved such as:
If args.Row("[Approved]") = False Then...

but this field is not part of the OrderDtl table. How can I refer to the
field PartRev.Approved which is part of a foreign key?

End Sub

Also, I am a newbie at VB.Net but a long time VBA programmer. Where
might I find good documentation that would help me answer questions like
this.

thanks in advance,

Randy Weber
IT Manager
TLC Electronics

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

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

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

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





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



I got it. Honestly, I'm not sure what I did different, but this is
working. Thanks again for your help.



Private Sub OrderDtl_AfterFieldChange(ByVal sender As object, ByVal args
As

DataColumnChangeEventArgs) Handles OrderDtl_Column.ColumnChanged

'// ** Argument Properties and Uses **

'// args.Row("[FieldName]")

'// args.Column, args.ProposedValue, args.Row

'

'Add Event Handler Code

'

Dim edvPR As EpiDataView =
CType(oTrans.EpiDataViews("Rev"),EpiDataView)

Dim vAprv As Boolean = edvPR.dataView(edvPR.Row)("Approved")



Select Case args.Column.ColumnName



Case "RevisionNum"

messagebox.show("Approved = " & vAprv)

Case Else



End Select



End Sub





From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Rob Bucek
Sent: Thursday, May 14, 2009 8:31 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] VB Code help - referring to a Foreign Key








My apologies Randy, when I gave that example I should have mentioned
that you need to modify that by the name given to your view. Perhaps I
could have saved you some time. Have you done any trace logging with
data changes to see what methods are being called? This might point you
to a more appropriate trigger for what you are trying to do.

If I struggle anywhere its usually finding an event on a particular form
that is good for what I'm trying to capture, change, or what have you.
Try setting up some message boxes with the variables you are trying to
get and see what methods are firing and what the value is at the time.

Course the more that I think about it, if it were me I'd be using a BPM
to do what you're trying to accomplish..

Rob Bucek

Manufacturing Engineer

PH: 715-284-5376 ext 311

FAX: 715-284-4084

<http://www.dsmfg.com/>

(Click the logo to view our site)

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Randy Weber
Sent: Thursday, May 14, 2009 8:06 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] VB Code help - referring to a Foreign Key

Rob,

I got it - sort of. The problem was that I was referring to PartRev as
the ViewName when I should have been using the name of the foreign key I
created called 'Rev'. Below works, but with another issue.

'Rev is a Foreign Key I created tying OrderDtl.PartNum to the
PartRev table.

Dim edvPR As EpiDataView = CType(oTrans.EpiDataViews("Rev"),EpiDataView)

Dim vAprv As Boolean

vAprv = edvPR.dataView(edvPR.Row)("Approved")

My other issue is that what gets returned is the previous value as
opposed to the current value. For example:

Rev 2 is current on the order.

I change to Rev 1 - not Approved. Return value=true

I choose Rev 2 - Approved. Return value=false

I tried changing from BeforeFieldChange to AfterFieldChange and I get
the same result - it always returns the previous value. Any suggestions?

Randy

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Rob Bucek
Sent: Wednesday, May 13, 2009 1:58 PM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] VB Code help - referring to a Foreign Key

It should all be under your sub try:

If edvPR.dataView(edvPR.Row)("Approved") = False Then....

With those Boolean ones Im not sure if at times a 1 or 0 may be
appropriate as that is actually the value you will see in the tables
themselves.

Rob Bucek

Manufacturing Engineer

PH: 715-284-5376 ext 311

FAX: 715-284-4084

<http://www.dsmfg.com/ <http://www.dsmfg.com/> >

(Click the logo to view our site)

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Randy Weber
Sent: Wednesday, May 13, 2009 1:34 PM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] VB Code help - referring to a Foreign Key

Rob,

Thanks for your help. I think I am close but I got an error: Error
Detail

============

Object reference not set to an instance of an object.

The error went away when I remmed out the second statement: Dim vAprv As
Boolean...

I placed the code inside my Private Sub OrderDtl_AfterFieldChange...

Is this the right location for both lines or do they have to be declared
elsewhere?

Randy Weber

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Rob Bucek
Sent: Wednesday, May 13, 2009 11:42 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] VB Code help - referring to a Foreign Key

Randy,

You need to declare the partrev view as a variable i.e.

Dim edvPR As EpiDataView = CType(oTrans.EpiDataViews("PartRev"),
EpiDataView)

This will allow you to then declare individual fields within that
view...

Dim vAprv As Boolean = edvPR.dataView(edvPR.Row)("Approved")

Maybe that will help you get going in the right direction..let me know
if you need more..

Rob Bucek

Manufacturing Engineer

PH: 715-284-5376 ext 311

FAX: 715-284-4084

<http://www.dsmfg.com/ <http://www.dsmfg.com/> <http://www.dsmfg.com/
<http://www.dsmfg.com/> > >

(Click the logo to view our site)

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Randy
Sent: Wednesday, May 13, 2009 11:26 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
Subject: [Vantage] VB Code help - referring to a Foreign Key

I am trying to validate that the Rev on a part is approved during order
entry. I have customized the form to display a foreign key from the
PartRev table.

I want to display an alert if the Rev is not approved. I'm not sure if I
am going about this the best way, but here's what I am trying:

Private Sub OrderDtl_AfterFieldChange(ByVal sender As object, ByVal args
As DataColumnChangeEventArgs) Handles OrderDtl_Column.ColumnChanged

'here I want to check to see if the PartRev is approved such as:
If args.Row("[Approved]") = False Then...

but this field is not part of the OrderDtl table. How can I refer to the
field PartRev.Approved which is part of a foreign key?

End Sub

Also, I am a newbie at VB.Net but a long time VBA programmer. Where
might I find good documentation that would help me answer questions like
this.

thanks in advance,

Randy Weber
IT Manager
TLC Electronics

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

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

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

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

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





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



Rob Bucek

Manufacturing Engineer

PH: 715-284-5376 ext 311

FAX: 715-284-4084

<http://www.dsmfg.com/>

(Click the logo to view our site)



________________________________

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Randy Weber
Sent: Thursday, May 14, 2009 9:14 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] VB Code help - referring to a Foreign Key





Rob,

I got it. Honestly, I'm not sure what I did different, but this is
working. Thanks again for your help.

Private Sub OrderDtl_AfterFieldChange(ByVal sender As object, ByVal args
As

DataColumnChangeEventArgs) Handles OrderDtl_Column.ColumnChanged

'// ** Argument Properties and Uses **

'// args.Row("[FieldName]")

'// args.Column, args.ProposedValue, args.Row

'

'Add Event Handler Code

'

Dim edvPR As EpiDataView =
CType(oTrans.EpiDataViews("Rev"),EpiDataView)

Dim vAprv As Boolean = edvPR.dataView(edvPR.Row)("Approved")

Select Case args.Column.ColumnName

Case "RevisionNum"

messagebox.show("Approved = " & vAprv)

Case Else

End Select

End Sub

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Rob Bucek
Sent: Thursday, May 14, 2009 8:31 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] VB Code help - referring to a Foreign Key

My apologies Randy, when I gave that example I should have mentioned
that you need to modify that by the name given to your view. Perhaps I
could have saved you some time. Have you done any trace logging with
data changes to see what methods are being called? This might point you
to a more appropriate trigger for what you are trying to do.

If I struggle anywhere its usually finding an event on a particular form
that is good for what I'm trying to capture, change, or what have you.
Try setting up some message boxes with the variables you are trying to
get and see what methods are firing and what the value is at the time.

Course the more that I think about it, if it were me I'd be using a BPM
to do what you're trying to accomplish..

Rob Bucek

Manufacturing Engineer

PH: 715-284-5376 ext 311

FAX: 715-284-4084

<http://www.dsmfg.com/ <http://www.dsmfg.com/> >

(Click the logo to view our site)

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Randy Weber
Sent: Thursday, May 14, 2009 8:06 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] VB Code help - referring to a Foreign Key

Rob,

I got it - sort of. The problem was that I was referring to PartRev as
the ViewName when I should have been using the name of the foreign key I
created called 'Rev'. Below works, but with another issue.

'Rev is a Foreign Key I created tying OrderDtl.PartNum to the
PartRev table.

Dim edvPR As EpiDataView = CType(oTrans.EpiDataViews("Rev"),EpiDataView)

Dim vAprv As Boolean

vAprv = edvPR.dataView(edvPR.Row)("Approved")

My other issue is that what gets returned is the previous value as
opposed to the current value. For example:

Rev 2 is current on the order.

I change to Rev 1 - not Approved. Return value=true

I choose Rev 2 - Approved. Return value=false

I tried changing from BeforeFieldChange to AfterFieldChange and I get
the same result - it always returns the previous value. Any suggestions?

Randy

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Rob Bucek
Sent: Wednesday, May 13, 2009 1:58 PM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] VB Code help - referring to a Foreign Key

It should all be under your sub try:

If edvPR.dataView(edvPR.Row)("Approved") = False Then....

With those Boolean ones Im not sure if at times a 1 or 0 may be
appropriate as that is actually the value you will see in the tables
themselves.

Rob Bucek

Manufacturing Engineer

PH: 715-284-5376 ext 311

FAX: 715-284-4084

<http://www.dsmfg.com/ <http://www.dsmfg.com/> <http://www.dsmfg.com/
<http://www.dsmfg.com/> > >

(Click the logo to view our site)

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Randy Weber
Sent: Wednesday, May 13, 2009 1:34 PM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] VB Code help - referring to a Foreign Key

Rob,

Thanks for your help. I think I am close but I got an error: Error
Detail

============

Object reference not set to an instance of an object.

The error went away when I remmed out the second statement: Dim vAprv As
Boolean...

I placed the code inside my Private Sub OrderDtl_AfterFieldChange...

Is this the right location for both lines or do they have to be declared
elsewhere?

Randy Weber

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Rob Bucek
Sent: Wednesday, May 13, 2009 11:42 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] VB Code help - referring to a Foreign Key

Randy,

You need to declare the partrev view as a variable i.e.

Dim edvPR As EpiDataView = CType(oTrans.EpiDataViews("PartRev"),
EpiDataView)

This will allow you to then declare individual fields within that
view...

Dim vAprv As Boolean = edvPR.dataView(edvPR.Row)("Approved")

Maybe that will help you get going in the right direction..let me know
if you need more..

Rob Bucek

Manufacturing Engineer

PH: 715-284-5376 ext 311

FAX: 715-284-4084

<http://www.dsmfg.com/ <http://www.dsmfg.com/> <http://www.dsmfg.com/
<http://www.dsmfg.com/> > <http://www.dsmfg.com/ <http://www.dsmfg.com/>

<http://www.dsmfg.com/ <http://www.dsmfg.com/> > > >

(Click the logo to view our site)

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Randy
Sent: Wednesday, May 13, 2009 11:26 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
Subject: [Vantage] VB Code help - referring to a Foreign Key

I am trying to validate that the Rev on a part is approved during order
entry. I have customized the form to display a foreign key from the
PartRev table.

I want to display an alert if the Rev is not approved. I'm not sure if I
am going about this the best way, but here's what I am trying:

Private Sub OrderDtl_AfterFieldChange(ByVal sender As object, ByVal args
As DataColumnChangeEventArgs) Handles OrderDtl_Column.ColumnChanged

'here I want to check to see if the PartRev is approved such as:
If args.Row("[Approved]") = False Then...

but this field is not part of the OrderDtl table. How can I refer to the
field PartRev.Approved which is part of a foreign key?

End Sub

Also, I am a newbie at VB.Net but a long time VBA programmer. Where
might I find good documentation that would help me answer questions like
this.

thanks in advance,

Randy Weber
IT Manager
TLC Electronics

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

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

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

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

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

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





[Non-text portions of this message have been removed]
I have a BAQ that uses one table (the JobHead table). I have several
different criteria that I need to pass through the BAQ. I need it to only
show Jobs that are not Closed, Jobs that are Released, Jobs that are Ready
for Mass Print. I have all of these criteria set up with the AND condition.
Then I also need it to show only for a list of Part Numbers that I have
(there are 9 different Part Numbers).

When I run the BAQ, I receive Unreleased Jobs, Closed Jobs and Jobs not
ready for Mass Print (MRP Jobs). I have tried the AND condition fields at
the top of the BAQ and the bottom of the BAQ. I only have one table, so I
know it is not a Join issue.

Is there a known problem in BAQ under Vantage 803.407C?

Thank you

Jeff



[Non-text portions of this message have been removed]
With all those conditions how are you joining them? I assume you
control your list by partnum = xxx and or partnum = yyy. Do you have an
'AND' join between all the others, then try a left paren before your
part list, use or conditions between part numbers followed by a right
paren? Or do I have it all mucked up with how you're setting it up?



JobClosed = False AND JobReleased = True And MassPrint = True And
(PartNum = 123 OR PartNum = ABC Or PartNum = etc)

I have a BAQ that uses one table (the JobHead table). I have several
different criteria that I need to pass through the BAQ. I need it to
only
show Jobs that are not Closed, Jobs that are Released, Jobs that are
Ready
for Mass Print. I have all of these criteria set up with the AND
condition.
Then I also need it to show only for a list of Part Numbers that I have
(there are 9 different Part Numbers).

When I run the BAQ, I receive Unreleased Jobs, Closed Jobs and Jobs not
ready for Mass Print (MRP Jobs). I have tried the AND condition fields
at
the top of the BAQ and the bottom of the BAQ. I only have one table, so
I
know it is not a Join issue.



Rob Bucek

Manufacturing Engineer

PH: 715-284-5376 ext 311

FAX: 715-284-4084

<http://www.dsmfg.com/>

(Click the logo to view our site)



________________________________

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Jeff Stockard
Sent: Thursday, May 14, 2009 9:39 AM
To: vantage@yahoogroups.com
Subject: [Vantage] BAQ Odd behavior





I have a BAQ that uses one table (the JobHead table). I have several
different criteria that I need to pass through the BAQ. I need it to
only
show Jobs that are not Closed, Jobs that are Released, Jobs that are
Ready
for Mass Print. I have all of these criteria set up with the AND
condition.
Then I also need it to show only for a list of Part Numbers that I have
(there are 9 different Part Numbers).

When I run the BAQ, I receive Unreleased Jobs, Closed Jobs and Jobs not
ready for Mass Print (MRP Jobs). I have tried the AND condition fields
at
the top of the BAQ and the bottom of the BAQ. I only have one table, so
I
know it is not a Join issue.

Is there a known problem in BAQ under Vantage 803.407C?

Thank you

Jeff

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





[Non-text portions of this message have been removed]
That did it. I didn't know what the column LeftP was used for. Then I
looked over on the other side and there was a RightP column. I didn't know
that you could use them for grouping.

Thanks for the help and the lesson Rob!

Jeff



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
Rob Bucek
Sent: Thursday, May 14, 2009 10:57 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] BAQ Odd behavior








With all those conditions how are you joining them? I assume you
control your list by partnum = xxx and or partnum = yyy. Do you have an
'AND' join between all the others, then try a left paren before your
part list, use or conditions between part numbers followed by a right
paren? Or do I have it all mucked up with how you're setting it up?

JobClosed = False AND JobReleased = True And MassPrint = True And
(PartNum = 123 OR PartNum = ABC Or PartNum = etc)

I have a BAQ that uses one table (the JobHead table). I have several
different criteria that I need to pass through the BAQ. I need it to
only
show Jobs that are not Closed, Jobs that are Released, Jobs that are
Ready
for Mass Print. I have all of these criteria set up with the AND
condition.
Then I also need it to show only for a list of Part Numbers that I have
(there are 9 different Part Numbers).

When I run the BAQ, I receive Unreleased Jobs, Closed Jobs and Jobs not
ready for Mass Print (MRP Jobs). I have tried the AND condition fields
at
the top of the BAQ and the bottom of the BAQ. I only have one table, so
I
know it is not a Join issue.

Rob Bucek

Manufacturing Engineer

PH: 715-284-5376 ext 311

FAX: 715-284-4084

<http://www.dsmfg.com/>

(Click the logo to view our site)

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Jeff Stockard
Sent: Thursday, May 14, 2009 9:39 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: [Vantage] BAQ Odd behavior

I have a BAQ that uses one table (the JobHead table). I have several
different criteria that I need to pass through the BAQ. I need it to
only
show Jobs that are not Closed, Jobs that are Released, Jobs that are
Ready
for Mass Print. I have all of these criteria set up with the AND
condition.
Then I also need it to show only for a list of Part Numbers that I have
(there are 9 different Part Numbers).

When I run the BAQ, I receive Unreleased Jobs, Closed Jobs and Jobs not
ready for Mass Print (MRP Jobs). I have tried the AND condition fields
at
the top of the BAQ and the bottom of the BAQ. I only have one table, so
I
know it is not a Join issue.

Is there a known problem in BAQ under Vantage 803.407C?

Thank you

Jeff

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

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





[Non-text portions of this message have been removed]
I think you guys are overcomplicating things.

Open sales order entry and go into customization.

Navigate to the Lines Tab & click on the part rev control.

In the properties window for that control (Datasource: OrderDtl, Datafield: RevisionNumber), look for a properties line called "SearchFilter". I'm betting the value is null.

Try entering (without the quotes) "Approved=True" and save the customization.

Reopen sales entry & look at the same control. If the parameters you entered (Approved=True) are still there - great: Just test the app with a partnumber causing you entry problems (entry of an unapproved rev) and verify the filtering has solved your problem.

If it hasn't, then you're back to hard coding a VB subroutine (as you are doing below).

Most part rev entry fields are capable of having this parameter entered.

Rob




________________________________
From: Lynn <lynn.khalife@...>
To: vantage@yahoogroups.com
Sent: Wednesday, May 13, 2009 1:17:59 PM
Subject: [Vantage] Re: VB Code help - referring to a Foreign Key





Dear Randy:

I need to do exactly the same thing. I'm on 8.03.404.

Assuming that you can get this to work, would you be willing to share any part of it?

Lynn

--- In vantage@yahoogroups .com, "Randy" <rweber@...> wrote:
>
> I am trying to validate that the Rev on a part is approved during order entry. I have customized the form to display a foreign key from the PartRev table.
>
> I want to display an alert if the Rev is not approved. I'm not sure if I am going about this the best way, but here's what I am trying:
>
> Private Sub OrderDtl_AfterField Change(ByVal sender As object, ByVal args As DataColumnChangeEve ntArgs) Handles OrderDtl_Column. ColumnChanged
>
> 'here I want to check to see if the PartRev is approved such as:
> If args.Row("[Approved ]") = False Then...
>
> but this field is not part of the OrderDtl table. How can I refer to the field PartRev.Approved which is part of a foreign key?
>
>
> End Sub
>
> Also, I am a newbie at VB.Net but a long time VBA programmer. Where might I find good documentation that would help me answer questions like this.
>
> thanks in advance,
>
> Randy Weber
> IT Manager
> TLC Electronics
>







[Non-text portions of this message have been removed]
Thanks, Rob. That's a nice shortcut. I'm a newbie at this so I had no
idea this was available. Our situation requires that we sometimes book
an order with an un-approved rev, so I still needed to learn how to give
a warning if it's not approved, yet allow them to book it. But this is a
nice way to accomplish the same thing in other places.





Randy Weber







From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Robert Brown
Sent: Thursday, May 14, 2009 2:02 PM
To: vantage@yahoogroups.com
Subject: Re: [Vantage] Re: VB Code help - referring to a Foreign Key








I think you guys are overcomplicating things.

Open sales order entry and go into customization.

Navigate to the Lines Tab & click on the part rev control.

In the properties window for that control (Datasource: OrderDtl,
Datafield: RevisionNumber), look for a properties line called
"SearchFilter". I'm betting the value is null.

Try entering (without the quotes) "Approved=True" and save the
customization.

Reopen sales entry & look at the same control. If the parameters you
entered (Approved=True) are still there - great: Just test the app with
a partnumber causing you entry problems (entry of an unapproved rev) and
verify the filtering has solved your problem.

If it hasn't, then you're back to hard coding a VB subroutine (as you
are doing below).

Most part rev entry fields are capable of having this parameter entered.


Rob

________________________________
From: Lynn <lynn.khalife@...
<mailto:lynn.khalife%40core-mfg.com> >
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Sent: Wednesday, May 13, 2009 1:17:59 PM
Subject: [Vantage] Re: VB Code help - referring to a Foreign Key

Dear Randy:

I need to do exactly the same thing. I'm on 8.03.404.

Assuming that you can get this to work, would you be willing to share
any part of it?

Lynn

--- In vantage@yahoogroups .com, "Randy" <rweber@...> wrote:
>
> I am trying to validate that the Rev on a part is approved during
order entry. I have customized the form to display a foreign key from
the PartRev table.
>
> I want to display an alert if the Rev is not approved. I'm not sure if
I am going about this the best way, but here's what I am trying:
>
> Private Sub OrderDtl_AfterField Change(ByVal sender As object, ByVal
args As DataColumnChangeEve ntArgs) Handles OrderDtl_Column.
ColumnChanged
>
> 'here I want to check to see if the PartRev is approved such as:
> If args.Row("[Approved ]") = False Then...
>
> but this field is not part of the OrderDtl table. How can I refer to
the field PartRev.Approved which is part of a foreign key?
>
>
> End Sub
>
> Also, I am a newbie at VB.Net but a long time VBA programmer. Where
might I find good documentation that would help me answer questions like
this.
>
> thanks in advance,
>
> Randy Weber
> IT Manager
> TLC Electronics
>

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





[Non-text portions of this message have been removed]
That's a tidy little trick...where did you learn that? Are there other
fields that works well with?



Rob Bucek

Manufacturing Engineer

PH: 715-284-5376 ext 311

FAX: 715-284-4084

<http://www.dsmfg.com/>

(Click the logo to view our site)



________________________________

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Robert Brown
Sent: Thursday, May 14, 2009 2:02 PM
To: vantage@yahoogroups.com
Subject: Re: [Vantage] Re: VB Code help - referring to a Foreign Key





I think you guys are overcomplicating things.

Open sales order entry and go into customization.

Navigate to the Lines Tab & click on the part rev control.

In the properties window for that control (Datasource: OrderDtl,
Datafield: RevisionNumber), look for a properties line called
"SearchFilter". I'm betting the value is null.

Try entering (without the quotes) "Approved=True" and save the
customization.

Reopen sales entry & look at the same control. If the parameters you
entered (Approved=True) are still there - great: Just test the app with
a partnumber causing you entry problems (entry of an unapproved rev) and
verify the filtering has solved your problem.

If it hasn't, then you're back to hard coding a VB subroutine (as you
are doing below).

Most part rev entry fields are capable of having this parameter entered.


Rob

________________________________
From: Lynn <lynn.khalife@...
<mailto:lynn.khalife%40core-mfg.com> >
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Sent: Wednesday, May 13, 2009 1:17:59 PM
Subject: [Vantage] Re: VB Code help - referring to a Foreign Key

Dear Randy:

I need to do exactly the same thing. I'm on 8.03.404.

Assuming that you can get this to work, would you be willing to share
any part of it?

Lynn

--- In vantage@yahoogroups .com, "Randy" <rweber@...> wrote:
>
> I am trying to validate that the Rev on a part is approved during
order entry. I have customized the form to display a foreign key from
the PartRev table.
>
> I want to display an alert if the Rev is not approved. I'm not sure if
I am going about this the best way, but here's what I am trying:
>
> Private Sub OrderDtl_AfterField Change(ByVal sender As object, ByVal
args As DataColumnChangeEve ntArgs) Handles OrderDtl_Column.
ColumnChanged
>
> 'here I want to check to see if the PartRev is approved such as:
> If args.Row("[Approved ]") = False Then...
>
> but this field is not part of the OrderDtl table. How can I refer to
the field PartRev.Approved which is part of a foreign key?
>
>
> End Sub
>
> Also, I am a newbie at VB.Net but a long time VBA programmer. Where
might I find good documentation that would help me answer questions like
this.
>
> thanks in advance,
>
> Randy Weber
> IT Manager
> TLC Electronics
>

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





[Non-text portions of this message have been removed]
What you are doing should be easy. Can't tell where you went astray without seeing your BAQ code.
Rob




________________________________
From: Jeff Stockard <jeff.stockard@...>
To: vantage@yahoogroups.com
Sent: Thursday, May 14, 2009 10:39:23 AM
Subject: [Vantage] BAQ Odd behavior





I have a BAQ that uses one table (the JobHead table). I have several
different criteria that I need to pass through the BAQ. I need it to only
show Jobs that are not Closed, Jobs that are Released, Jobs that are Ready
for Mass Print. I have all of these criteria set up with the AND condition.
Then I also need it to show only for a list of Part Numbers that I have
(there are 9 different Part Numbers).

When I run the BAQ, I receive Unreleased Jobs, Closed Jobs and Jobs not
ready for Mass Print (MRP Jobs). I have tried the AND condition fields at
the top of the BAQ and the bottom of the BAQ. I only have one table, so I
know it is not a Join issue.

Is there a known problem in BAQ under Vantage 803.407C?

Thank you

Jeff

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







[Non-text portions of this message have been removed]
I'm not quite getting this. What does the SearchFilter property of a Vantage control do?

--
Brian W. Spolarich ~ Manager, Information Services ~ Advanced Photonix / Picometrix
    bspolarich@... ~ 734-864-5618 ~ www.advancedphotonix.com


-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Rob Bucek
Sent: Thursday, May 14, 2009 3:35 PM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Re: VB Code help - referring to a Foreign Key

That's a tidy little trick...where did you learn that? Are there other
fields that works well with?



Rob Bucek

Manufacturing Engineer

PH: 715-284-5376 ext 311

FAX: 715-284-4084

<http://www.dsmfg.com/>

(Click the logo to view our site)



________________________________

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Robert Brown
Sent: Thursday, May 14, 2009 2:02 PM
To: vantage@yahoogroups.com
Subject: Re: [Vantage] Re: VB Code help - referring to a Foreign Key





I think you guys are overcomplicating things.

Open sales order entry and go into customization.

Navigate to the Lines Tab & click on the part rev control.

In the properties window for that control (Datasource: OrderDtl,
Datafield: RevisionNumber), look for a properties line called
"SearchFilter". I'm betting the value is null.

Try entering (without the quotes) "Approved=True" and save the
customization.

Reopen sales entry & look at the same control. If the parameters you
entered (Approved=True) are still there - great: Just test the app with
a partnumber causing you entry problems (entry of an unapproved rev) and
verify the filtering has solved your problem.

If it hasn't, then you're back to hard coding a VB subroutine (as you
are doing below).

Most part rev entry fields are capable of having this parameter entered.


Rob

________________________________
From: Lynn <lynn.khalife@...
<mailto:lynn.khalife%40core-mfg.com> >
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Sent: Wednesday, May 13, 2009 1:17:59 PM
Subject: [Vantage] Re: VB Code help - referring to a Foreign Key

Dear Randy:

I need to do exactly the same thing. I'm on 8.03.404.

Assuming that you can get this to work, would you be willing to share
any part of it?

Lynn

--- In vantage@yahoogroups .com, "Randy" <rweber@...> wrote:
>
> I am trying to validate that the Rev on a part is approved during
order entry. I have customized the form to display a foreign key from
the PartRev table.
>
> I want to display an alert if the Rev is not approved. I'm not sure if
I am going about this the best way, but here's what I am trying:
>
> Private Sub OrderDtl_AfterField Change(ByVal sender As object, ByVal
args As DataColumnChangeEve ntArgs) Handles OrderDtl_Column.
ColumnChanged
>
> 'here I want to check to see if the PartRev is approved such as:
> If args.Row("[Approved ]") = False Then...
>
> but this field is not part of the OrderDtl table. How can I refer to
the field PartRev.Approved which is part of a foreign key?
>
>
> End Sub
>
> Also, I am a newbie at VB.Net but a long time VBA programmer. Where
might I find good documentation that would help me answer questions like
this.
>
> thanks in advance,
>
> Randy Weber
> IT Manager
> TLC Electronics
>

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





[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
This is new to me but I can tell you how it behaved.



I set the search filter to Approved=True per Robert Brown's advice.
After that, when entering a part on a sales order, the Rev combo
displayed only Approved Revisions. Pretty slick - huh?



Randy Weber



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Brian W. Spolarich
Sent: Thursday, May 14, 2009 2:40 PM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Re: VB Code help - referring to a Foreign Key








I'm not quite getting this. What does the SearchFilter property of a
Vantage control do?

--
Brian W. Spolarich ~ Manager, Information Services ~ Advanced Photonix /
Picometrix
bspolarich@...
<mailto:bspolarich%40advancedphotonix.com> ~ 734-864-5618 ~
www.advancedphotonix.com

-----Original Message-----
From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf Of Rob Bucek
Sent: Thursday, May 14, 2009 3:35 PM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] Re: VB Code help - referring to a Foreign Key

That's a tidy little trick...where did you learn that? Are there other
fields that works well with?

Rob Bucek

Manufacturing Engineer

PH: 715-284-5376 ext 311

FAX: 715-284-4084

<http://www.dsmfg.com/>

(Click the logo to view our site)

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Robert Brown
Sent: Thursday, May 14, 2009 2:02 PM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: Re: [Vantage] Re: VB Code help - referring to a Foreign Key

I think you guys are overcomplicating things.

Open sales order entry and go into customization.

Navigate to the Lines Tab & click on the part rev control.

In the properties window for that control (Datasource: OrderDtl,
Datafield: RevisionNumber), look for a properties line called
"SearchFilter". I'm betting the value is null.

Try entering (without the quotes) "Approved=True" and save the
customization.

Reopen sales entry & look at the same control. If the parameters you
entered (Approved=True) are still there - great: Just test the app with
a partnumber causing you entry problems (entry of an unapproved rev) and
verify the filtering has solved your problem.

If it hasn't, then you're back to hard coding a VB subroutine (as you
are doing below).

Most part rev entry fields are capable of having this parameter entered.

Rob

________________________________
From: Lynn <lynn.khalife@...
<mailto:lynn.khalife%40core-mfg.com>
<mailto:lynn.khalife%40core-mfg.com> >
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
Sent: Wednesday, May 13, 2009 1:17:59 PM
Subject: [Vantage] Re: VB Code help - referring to a Foreign Key

Dear Randy:

I need to do exactly the same thing. I'm on 8.03.404.

Assuming that you can get this to work, would you be willing to share
any part of it?

Lynn

--- In vantage@yahoogroups .com, "Randy" <rweber@...> wrote:
>
> I am trying to validate that the Rev on a part is approved during
order entry. I have customized the form to display a foreign key from
the PartRev table.
>
> I want to display an alert if the Rev is not approved. I'm not sure if
I am going about this the best way, but here's what I am trying:
>
> Private Sub OrderDtl_AfterField Change(ByVal sender As object, ByVal
args As DataColumnChangeEve ntArgs) Handles OrderDtl_Column.
ColumnChanged
>
> 'here I want to check to see if the PartRev is approved such as:
> If args.Row("[Approved ]") = False Then...
>
> but this field is not part of the OrderDtl table. How can I refer to
the field PartRev.Approved which is part of a foreign key?
>
>
> End Sub
>
> Also, I am a newbie at VB.Net but a long time VBA programmer. Where
might I find good documentation that would help me answer questions like
this.
>
> thanks in advance,
>
> Randy Weber
> IT Manager
> TLC Electronics
>

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

[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/.
<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]
The control has a BO method associated with it - In the case of Rev (for Part) - it is probably a GetByID method.

When you fill in this info (Approved=True), you are essentially passing GetByID() an additional search criteria argument.

Rob




________________________________
From: Brian W. Spolarich <bspolarich@...>
To: vantage@yahoogroups.com
Sent: Thursday, May 14, 2009 3:40:03 PM
Subject: RE: [Vantage] Re: VB Code help - referring to a Foreign Key





I'm not quite getting this. What does the SearchFilter property of a Vantage control do?

--
Brian W. Spolarich ~ Manager, Information Services ~ Advanced Photonix / Picometrix
    bspolarich@advanced photonix. com ~ 734-864-5618 ~ www.advancedphotoni x.com

-----Original Message-----
From: vantage@yahoogroups .com [mailto:vantage@yahoogroups .com] On Behalf Of Rob Bucek
Sent: Thursday, May 14, 2009 3:35 PM
To: vantage@yahoogroups .com
Subject: RE: [Vantage] Re: VB Code help - referring to a Foreign Key

That's a tidy little trick...where did you learn that? Are there other
fields that works well with?

Rob Bucek

Manufacturing Engineer

PH: 715-284-5376 ext 311

FAX: 715-284-4084

<http://www.dsmfg. com/>

(Click the logo to view our site)

____________ _________ _________ __

From: vantage@yahoogroups .com [mailto:vantage@yahoogroups .com] On Behalf
Of Robert Brown
Sent: Thursday, May 14, 2009 2:02 PM
To: vantage@yahoogroups .com
Subject: Re: [Vantage] Re: VB Code help - referring to a Foreign Key

I think you guys are overcomplicating things.

Open sales order entry and go into customization.

Navigate to the Lines Tab & click on the part rev control.

In the properties window for that control (Datasource: OrderDtl,
Datafield: RevisionNumber) , look for a properties line called
"SearchFilter" . I'm betting the value is null.

Try entering (without the quotes) "Approved=True" and save the
customization.

Reopen sales entry & look at the same control. If the parameters you
entered (Approved=True) are still there - great: Just test the app with
a partnumber causing you entry problems (entry of an unapproved rev) and
verify the filtering has solved your problem.

If it hasn't, then you're back to hard coding a VB subroutine (as you
are doing below).

Most part rev entry fields are capable of having this parameter entered.

Rob

____________ _________ _________ __
From: Lynn <lynn.khalife@ core-mfg. com
<mailto:lynn. khalife%40core- mfg.com> >
To: vantage@yahoogroups .com <mailto:vantage% 40yahoogroups. com>
Sent: Wednesday, May 13, 2009 1:17:59 PM
Subject: [Vantage] Re: VB Code help - referring to a Foreign Key

Dear Randy:

I need to do exactly the same thing. I'm on 8.03.404.

Assuming that you can get this to work, would you be willing to share
any part of it?

Lynn

--- In vantage@yahoogroups .com, "Randy" <rweber@...> wrote:
>
> I am trying to validate that the Rev on a part is approved during
order entry. I have customized the form to display a foreign key from
the PartRev table.
>
> I want to display an alert if the Rev is not approved. I'm not sure if
I am going about this the best way, but here's what I am trying:
>
> Private Sub OrderDtl_AfterField Change(ByVal sender As object, ByVal
args As DataColumnChangeEve ntArgs) Handles OrderDtl_Column.
ColumnChanged
>
> 'here I want to check to see if the PartRev is approved such as:
> If args.Row("[Approved ]") = False Then...
>
> but this field is not part of the OrderDtl table. How can I refer to
the field PartRev.Approved which is part of a foreign key?
>
>
> End Sub
>
> Also, I am a newbie at VB.Net but a long time VBA programmer. Where
might I find good documentation that would help me answer questions like
this.
>
> thanks in advance,
>
> Randy Weber
> IT Manager
> TLC Electronics
>

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

[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]