Referencing other tables - code snippets

Before doing his via vb code (that has to be maintained forever) go to data tools and attempt to add the tables you desire as foreign key views or subtables (of a foreign key views).

Doing this makes them visible to the customization environment (where as VB function added tables are not visible to the environment).

Example: Material Issue has an "IM" native dataview. You can add a JobHead FKV to the IM table.

Once JobHead is added as an FKV, you can add almost all other job related tables (JobProd, JobOper, JobOpDtl, JobMtl, etc.,) as SubTables to the FKV JobHead table.

You must define the parent/child column joins (typically always want to reference Company then, in this case, JobNum, etc.,).

It is not always possible to find a 'path' to get from the native tables to the one you wish to include in the app.

When that proves true, set up a Function (intended to return whatever related data from your non native table you require based upon passing the function valid input variables). Go to Object Explorer and find the data table you are interested in and the method you wish to use to access the table (typically SearchByID). Copy the sample code snippets into your function (adjusting them to suit your app & purpose) and also make not of the 3 assembly DLLs required.

Go to Assemblies and add the three referenced assemblies as custom assemblies. (Without this, your code won't work.)

...Like I said, TRY using the data tools and FKV's/SubTables first!

It is much cleaner.

Rob Brown

--- On Thu, 5/1/08, Kunal Ganguly <kunal_vantage@...> wrote:

From: Kunal Ganguly <kunal_vantage@...>
Subject: [Vantage] referencing other tables - code snippets
To: "Vantage Yahoo Group" <vantage@yahoogroups.com>
Date: Thursday, May 1, 2008, 7:52 AM






I need to get some data from separate tables into a form. Unfortunately, in the form designer the tables that I need are not shown as a data source. Would it be possible for someone to post some production or simply working code which does this.
Thanks,
Kunal

____________ _________ _________ _________ _________ _________ _
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile. yahoo.com/ ;_ylt=Ahu06i62sR 8HDtDypao8Wcj9tA cJ

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
















____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
I need to get some data from separate tables into a form. Unfortunately, in the form designer the tables that I need are not shown as a data source. Would it be possible for someone to post some production or simply working code which does this.
Thanks,
Kunal


____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

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

Form?

Desired tables?


--- In vantage@yahoogroups.com, Kunal Ganguly <kunal_vantage@...> wrote:
>
> I need to get some data from separate tables into a form.
Unfortunately, in the form designer the tables that I need are not
shown as a data source. Would it be possible for someone to post some
production or simply working code which does this.
> Thanks,
> Kunal
>
>
>
________________________________________________________________________
____________
> Be a better friend, newshound, and
> know-it-all with Yahoo! Mobile. Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
>
> [Non-text portions of this message have been removed]
>
My bad, that first e-mail was rather lacking in information!

Version: 8.03.404A
Form: Shipping & Receiving | Gen Ops | Customer Shipment Entry
Tables: OrderHed, Terms

Any generic examples not having anything to do with the above would be fine too.

-Kunal


----- Original Message ----
From: bw2868bond <bwalker@...>
To: vantage@yahoogroups.com
Sent: Thursday, May 1, 2008 6:55:13 AM
Subject: [Vantage] Re: referencing other tables - code snippets


Version?

Form?

Desired tables?

--- In vantage@yahoogroups .com, Kunal Ganguly <kunal_vantage@ ...> wrote:
>
> I need to get some data from separate tables into a form.
Unfortunately, in the form designer the tables that I need are not
shown as a data source. Would it be possible for someone to post some
production or simply working code which does this.
> Thanks,
> Kunal
>
>
>
____________ _________ _________ _________ _________ _________ _
____________
> Be a better friend, newshound, and
> know-it-all with Yahoo! Mobile. Try it now.
http://mobile. yahoo.com/ ;_ylt=Ahu06i62sR 8HDtDypao8Wcj9tA cJ
>
> [Non-text portions of this message have been removed]
>




____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

[Non-text portions of this message have been removed]
OK, Customization Tools Dialog, Tools menu, Data Tools.

Click New Custom View, Give a descriptive name for View Name like
OrdHedView. In the Parent View Name drop down, pick ShipHead. In
Column Name drop down pick OrderNum - Click Add button you should get
a foreign key view sucessful dialog box - click OK. Save you
Customization. Re open it and you should be able to use fields from
order header now on your form. The terms code and terms code
description are available in the view you added to the data tools.

Many times you can get data from other tables when there is a field
used in one of the native dataviews that is a key field to get data
from a different table. There are instances when you just cant get
there using Foreign Key Views or another view from a FKV. Then you
will have to get creative and start using list lookups. If you cant
find what you need using a list lookup then you will have to add
adapters, dataviews, etc.

I always try to start with the easy way first :o)

bw


--- In vantage@yahoogroups.com, Kunal Ganguly <kunal_vantage@...>
wrote:
>
> My bad, that first e-mail was rather lacking in information!
>
> Version: 8.03.404A
> Form: Shipping & Receiving | Gen Ops | Customer Shipment Entry
> Tables: OrderHed, Terms
>
> Any generic examples not having anything to do with the above would
be fine too.
>
> -Kunal
>
>
> ----- Original Message ----
> From: bw2868bond <bwalker@...>
> To: vantage@yahoogroups.com
> Sent: Thursday, May 1, 2008 6:55:13 AM
> Subject: [Vantage] Re: referencing other tables - code snippets
>
>
> Version?
>
> Form?
>
> Desired tables?
>
> --- In vantage@yahoogroups .com, Kunal Ganguly <kunal_vantage@ ...>
wrote:
> >
> > I need to get some data from separate tables into a form.
> Unfortunately, in the form designer the tables that I need are not
> shown as a data source. Would it be possible for someone to post
some
> production or simply working code which does this.
> > Thanks,
> > Kunal
> >
> >
> >
> ____________ _________ _________ _________ _________ _________ _
> ____________
> > Be a better friend, newshound, and
> > know-it-all with Yahoo! Mobile. Try it now.
> http://mobile. yahoo.com/ ;_ylt=Ahu06i62sR 8HDtDypao8Wcj9tA cJ
> >
> > [Non-text portions of this message have been removed]
> >
>
>
>
>
>
______________________________________________________________________
______________
> Be a better friend, newshound, and
> know-it-all with Yahoo! Mobile. Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
>
> [Non-text portions of this message have been removed]
>
Thank you very much! That will be a huge huge help for some other customizations I need to do as well :))

For some reason the custom form elements (tried both textbox and combo) I added for terms and freight are blank when i bring up some data on the customer shipment entry form. The Shipment entry form allows picking of a pack id, and the order number field below it shows up as blank, I wonder if this is why the terms and freight elements I created are blank.

Also, for future reference, would it be possible to share some custom code that deals with adapters and dataviews in the context of this discussion?

Thanks,
Kunal


----- Original Message ----
From: bw2868bond <bwalker@...>
To: vantage@yahoogroups.com
Sent: Thursday, May 1, 2008 8:12:36 AM
Subject: [Vantage] Re: referencing other tables - code snippets


OK, Customization Tools Dialog, Tools menu, Data Tools.

Click New Custom View, Give a descriptive name for View Name like
OrdHedView. In the Parent View Name drop down, pick ShipHead. In
Column Name drop down pick OrderNum - Click Add button you should get
a foreign key view sucessful dialog box - click OK. Save you
Customization. Re open it and you should be able to use fields from
order header now on your form. The terms code and terms code
description are available in the view you added to the data tools.

Many times you can get data from other tables when there is a field
used in one of the native dataviews that is a key field to get data
from a different table. There are instances when you just cant get
there using Foreign Key Views or another view from a FKV. Then you
will have to get creative and start using list lookups. If you cant
find what you need using a list lookup then you will have to add
adapters, dataviews, etc.

I always try to start with the easy way first :o)

bw

--- In vantage@yahoogroups .com, Kunal Ganguly <kunal_vantage@ ...>
wrote:
>
> My bad, that first e-mail was rather lacking in information!
>
> Version: 8.03.404A
> Form: Shipping & Receiving | Gen Ops | Customer Shipment Entry
> Tables: OrderHed, Terms
>
> Any generic examples not having anything to do with the above would
be fine too.
>
> -Kunal
>
>
> ----- Original Message ----
> From: bw2868bond <bwalker@... >
> To: vantage@yahoogroups .com
> Sent: Thursday, May 1, 2008 6:55:13 AM
> Subject: [Vantage] Re: referencing other tables - code snippets
>
>
> Version?
>
> Form?
>
> Desired tables?
>
> --- In vantage@yahoogroups .com, Kunal Ganguly <kunal_vantage@ ...>
wrote:
> >
> > I need to get some data from separate tables into a form.
> Unfortunately, in the form designer the tables that I need are not
> shown as a data source. Would it be possible for someone to post
some
> production or simply working code which does this.
> > Thanks,
> > Kunal
> >
> >
> >
> ____________ _________ _________ _________ _________ _________ _
> ____________
> > Be a better friend, newshound, and
> > know-it-all with Yahoo! Mobile. Try it now.
> http://mobile. yahoo.com/ ;_ylt=Ahu06i62sR 8HDtDypao8Wcj9tA cJ
> >
> > [Non-text portions of this message have been removed]
> >
>
>
>
>
>
____________ _________ _________ _________ _________ _________ _
____________ __
> Be a better friend, newshound, and
> know-it-all with Yahoo! Mobile. Try it now.
http://mobile. yahoo.com/ ;_ylt=Ahu06i62sR 8HDtDypao8Wcj9tA cJ
>
> [Non-text portions of this message have been removed]
>




____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

[Non-text portions of this message have been removed]
Ok, figured it out - if I use the ShipDtl table, the data displays normally. TYVM BW for your help.

I have quite a few more customizations remaining which I am pretty sure will require code since (I think) there will be no foreign key that I can use.

-Kunal


----- Original Message ----
From: Kunal Ganguly <kunal_vantage@...>
To: vantage@yahoogroups.com
Sent: Thursday, May 1, 2008 9:18:56 AM
Subject: Re: [Vantage] Re: referencing other tables - code snippets


Thank you very much! That will be a huge huge help for some other customizations I need to do as well :))

For some reason the custom form elements (tried both textbox and combo) I added for terms and freight are blank when i bring up some data on the customer shipment entry form. The Shipment entry form allows picking of a pack id, and the order number field below it shows up as blank, I wonder if this is why the terms and freight elements I created are blank.

Also, for future reference, would it be possible to share some custom code that deals with adapters and dataviews in the context of this discussion?

Thanks,
Kunal

----- Original Message ----
From: bw2868bond <bwalker@adcocircuit s.com>
To: vantage@yahoogroups .com
Sent: Thursday, May 1, 2008 8:12:36 AM
Subject: [Vantage] Re: referencing other tables - code snippets

OK, Customization Tools Dialog, Tools menu, Data Tools.

Click New Custom View, Give a descriptive name for View Name like
OrdHedView. In the Parent View Name drop down, pick ShipHead. In
Column Name drop down pick OrderNum - Click Add button you should get
a foreign key view sucessful dialog box - click OK. Save you
Customization. Re open it and you should be able to use fields from
order header now on your form. The terms code and terms code
description are available in the view you added to the data tools.

Many times you can get data from other tables when there is a field
used in one of the native dataviews that is a key field to get data
from a different table. There are instances when you just cant get
there using Foreign Key Views or another view from a FKV. Then you
will have to get creative and start using list lookups. If you cant
find what you need using a list lookup then you will have to add
adapters, dataviews, etc.

I always try to start with the easy way first :o)

bw

--- In vantage@yahoogroups .com, Kunal Ganguly <kunal_vantage@ ...>
wrote:
>
> My bad, that first e-mail was rather lacking in information!
>
> Version: 8.03.404A
> Form: Shipping & Receiving | Gen Ops | Customer Shipment Entry
> Tables: OrderHed, Terms
>
> Any generic examples not having anything to do with the above would
be fine too.
>
> -Kunal
>
>
> ----- Original Message ----
> From: bw2868bond <bwalker@... >
> To: vantage@yahoogroups .com
> Sent: Thursday, May 1, 2008 6:55:13 AM
> Subject: [Vantage] Re: referencing other tables - code snippets
>
>
> Version?
>
> Form?
>
> Desired tables?
>
> --- In vantage@yahoogroups .com, Kunal Ganguly <kunal_vantage@ ...>
wrote:
> >
> > I need to get some data from separate tables into a form.
> Unfortunately, in the form designer the tables that I need are not
> shown as a data source. Would it be possible for someone to post
some
> production or simply working code which does this.
> > Thanks,
> > Kunal
> >
> >
> >
> ____________ _________ _________ _________ _________ _________ _
> ____________
> > Be a better friend, newshound, and
> > know-it-all with Yahoo! Mobile. Try it now.
> http://mobile. yahoo.com/ ;_ylt=Ahu06i62sR 8HDtDypao8Wcj9tA cJ
> >
> > [Non-text portions of this message have been removed]
> >
>
>
>
>
>
____________ _________ _________ _________ _________ _________ _
____________ __
> Be a better friend, newshound, and
> know-it-all with Yahoo! Mobile. Try it now.
http://mobile. yahoo.com/ ;_ylt=Ahu06i62sR 8HDtDypao8Wcj9tA cJ
>
> [Non-text portions of this message have been removed]
>

____________ _________ _________ _________ _________ _________ _
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile. yahoo.com/ ;_ylt=Ahu06i62sR 8HDtDypao8Wcj9tA cJ

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




____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

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