User-Defined Table as FKC

--- In vantage@yahoogroups.com, "bw2868bond" <bwalker@...> wrote:
Except for the bracketed parts, which are view and table names, that IS my code. Rather, it's the code I am trying to use. UD01 is the table I want. Rob helped me out with the underscores, at least partially. There's still one line that isn't right:

Project.DataView = Project.Row.dataView

which is my version of what's in the example, underscores replaced by dots, and the error message patiently points out that 'dataView' is not a member of 'Integer', which is what it expected with the 'Row' property.

TIA,
Lynn thomas


> Perhaps if you posted your actual code we could maybe spot the error....
>
> --- In vantage@yahoogroups.com, "Lynn Thomas 83" <thomasl@> wrote:
> >
I'm using 405A on SQL and have a user-defined table that I need to
connect and use in several places, so that we can keep our colors of money separated without too much agony. Help has an article entitled "How can a user-defined table become a foreign key view option?" Wonderful! That's exactly what I need. I start copying the code as directed. I promptly get all sorts of odd errors...definitely NOT wonderful.
> >
After a couple days of digging into this, I can't for the life of me
figure out what's not correct. I've added the necessary assemblies, so it's not that. One thing that keeps cropping up is the 'object
reference not set to an instance of an object', especially with respect to the highlighted line. Help?
> >
>
I'm using 405A on SQL and have a user-defined table that I need to
connect and use in several places, so that we can keep our colors of
money separated without too much agony. Help has an article entitled
"How can a user-defined table become a foreign key view option?"
Wonderful! That's exactly what I need. I start copying the code as
directed. I promptly get all sorts of odd errors...definitely NOT
wonderful.

After a couple days of digging into this, I can't for the life of me
figure out what's not correct. I've added the necessary assemblies, so
it's not that. One thing that keeps cropping up is the 'object
reference not set to an instance of an object', especially with respect
to the highlighted line. Help?

Also, can someone tell me what's going on with the objectname_something
else business? I'm seeing that crop up in lots of these scripts, and
when it's already there things work fine. When I type it in, not so
good, but no clue as to exactly what I've missed. In the Read-Only
version of the code module, I see lots and lots of "ViewName_Column"
declared as a table, and "ViewName_Row" as a dataview, but only
"ViewName" in the Object explorer. My reference books don't mention
this if it's a widely accepted convention, and I'm a long time from my
programming classes.

The below comes straight from the help doc, with my highlights and some
white space editing:

Vantage comes with 20 standalone user-defined tables and 11 parent/child
tables. These special tables let you customize the database so you can
enter data that is unique to your company. Normally the data entered in
a user-defined table will be linked to a form using an UltraCombo
control. This control lets you display your data through a drop-down
list.
For more instructions on User-Defined Tables and the UltraCombo control,
read the User-Defined Tables topic.
By editing a form's .xml file, however, you can also link a user-defined
table to a Foreign Key View on the form. You can then access this
user-defined table from nearly every control within your customization.
The user-defined table will become available from the Parent View Name
list within the Custom Data Dialog window.

What to Do

To do this, launch the program in developer mode. Within the
Customization Tools Dialog, click on the Script Editor tab.

Add the following .xml code (it is displayed below in bold) to the
form's script. Throughout this script, you will need to substitute the
following variables:

• [Your Parent View] - substitute this variable with the parent
view that applies to this form.
• [Your Parent View Field] - substitute this variable with the
specific field from your parent view.
• [UDXX] - substitute this variable with the specific
user-defined table number - UD03, UD06, UD07, and so on.
Return to top

UDXX "Foreign Key View" Script

Imports System
Imports System.Data
Imports System.Diagnostics
Imports System.Windows.Forms
Imports System.ComponentModel
Imports Epicor.Mfg.UI
Imports Epicor.Mfg.UI.FrameWork
Imports Epicor.Mfg.UI.ExtendedProps
Imports Epicor.Mfg.UI.FormFunctions
Imports Epicor.Mfg.UI.Customization

Module Script

Private WithEvents [Your Parent View] As DataView

'// ** Wizard Insert Location **
'// Begin Wizard Added Module Level Variables **
'// End Wizard Added Module Level Variables **
'// Add Custom Module Level Variables Here **

Sub InitializeCustomCode()

[Your Parent View]_DataView = [Your Parent View]_Row.dataView

'// ** Wizard Insert Location - Do not delete 'Begin/End
Custom Method Calls' lines **
'// Begin Wizard Added Variable Intialization
'// End Wizard Added Variable Intialization

InitializeProcCallDataViews()

'// Begin Custom Method Calls
'// End Custom Method Calls
End Sub

Private Sub InitializeProcCallDataViews()

Dim whereClause As String
'// construct Where Clause that will return and empty DataSet
whereClause = "Key1 = '$%' And Key2 = '$%' And Key3 = '$%' And
Key4 = '$%' And Key5 = '$%'"
csm.UpdateProcCallDataView("[UDXX]Adapter","[UDXX]",
whereClause, "[UDXX]View", True)
End Sub
Private Sub Get[UDXX]Record(key1 As String, key2 As String, key3 As
String, key4 As String, key5 As String)
Dim whereClause As String
whereClause = "Key1 = '" & key1 & "' And Key2 = '" & key2 & "' And
Key3 = '" & key3 + "' And Key4 = '" & key4 & "' And Key5 = '" & key5 +
"'"
csm.UpdateProcCallDataView("[UDXX]Adapter","[UDXX]", whereClause,
"[UDXX]View", False)

End Sub


Private Sub [Your Parent View]_AfterRowChange(ByVal args As
EpiRowChangedArgs) Handles [Your Parent View]_Row.EpiRowChanged

Dim Key1 As String =
args.CurrentView.dataView(args.CurrentRow)("[Your Parent View
Field]").ToString()
Dim Key2 As String = String.Empty
Dim Key3 As String = String.Empty
Dim Key4 As String = String.Empty
Dim Key5 As String = String.Empty
Get[UDXX]Record(Key1, Key2, Key3, Key4, Key5)

End Sub


Private Sub [Your Parent View]_DataView_ListChanged(ByVal sender As
Object, ByVal args As ListChangedEventArgs) Handles [Your Parent
View]_DataView.ListChanged

Dim Key1 As String = [Your Parent View]_DataView(0)("[Your Parent
View Field]").ToString()
Dim Key2 As String = String.Empty
Dim Key3 As String = String.Empty
Dim Key4 As String = String.Empty
Dim Key5 As String = String.Empty
Get[UDXX]Record(Key1, Key2, Key3, Key4, Key5)
End Sub

Thanks in advance,
Lynn Thomas
SAIC



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



Did you add the assembly references? Tools/assembly reference manager.
Look for the Dll's relating to the UD table you're after (re: AD, BO,
IF)



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 Lynn Thomas 83
Sent: Thursday, April 23, 2009 8:39 AM
To: vantage@yahoogroups.com
Subject: [Vantage] User-Defined Table as FKC





I'm using 405A on SQL and have a user-defined table that I need to
connect and use in several places, so that we can keep our colors of
money separated without too much agony. Help has an article entitled
"How can a user-defined table become a foreign key view option?"
Wonderful! That's exactly what I need. I start copying the code as
directed. I promptly get all sorts of odd errors...definitely NOT
wonderful.

After a couple days of digging into this, I can't for the life of me
figure out what's not correct. I've added the necessary assemblies, so
it's not that. One thing that keeps cropping up is the 'object
reference not set to an instance of an object', especially with respect
to the highlighted line. Help?

Also, can someone tell me what's going on with the objectname_something
else business? I'm seeing that crop up in lots of these scripts, and
when it's already there things work fine. When I type it in, not so
good, but no clue as to exactly what I've missed. In the Read-Only
version of the code module, I see lots and lots of "ViewName_Column"
declared as a table, and "ViewName_Row" as a dataview, but only
"ViewName" in the Object explorer. My reference books don't mention
this if it's a widely accepted convention, and I'm a long time from my
programming classes.

The below comes straight from the help doc, with my highlights and some
white space editing:

Vantage comes with 20 standalone user-defined tables and 11 parent/child
tables. These special tables let you customize the database so you can
enter data that is unique to your company. Normally the data entered in
a user-defined table will be linked to a form using an UltraCombo
control. This control lets you display your data through a drop-down
list.
For more instructions on User-Defined Tables and the UltraCombo control,
read the User-Defined Tables topic.
By editing a form's .xml file, however, you can also link a user-defined
table to a Foreign Key View on the form. You can then access this
user-defined table from nearly every control within your customization.
The user-defined table will become available from the Parent View Name
list within the Custom Data Dialog window.

What to Do

To do this, launch the program in developer mode. Within the
Customization Tools Dialog, click on the Script Editor tab.

Add the following .xml code (it is displayed below in bold) to the
form's script. Throughout this script, you will need to substitute the
following variables:

* [Your Parent View] - substitute this variable with the parent
view that applies to this form.
* [Your Parent View Field] - substitute this variable with the
specific field from your parent view.
* [UDXX] - substitute this variable with the specific
user-defined table number - UD03, UD06, UD07, and so on.
Return to top

UDXX "Foreign Key View" Script

Imports System
Imports System.Data
Imports System.Diagnostics
Imports System.Windows.Forms
Imports System.ComponentModel
Imports Epicor.Mfg.UI
Imports Epicor.Mfg.UI.FrameWork
Imports Epicor.Mfg.UI.ExtendedProps
Imports Epicor.Mfg.UI.FormFunctions
Imports Epicor.Mfg.UI.Customization

Module Script

Private WithEvents [Your Parent View] As DataView

'// ** Wizard Insert Location **
'// Begin Wizard Added Module Level Variables **
'// End Wizard Added Module Level Variables **
'// Add Custom Module Level Variables Here **

Sub InitializeCustomCode()

[Your Parent View]_DataView = [Your Parent View]_Row.dataView

'// ** Wizard Insert Location - Do not delete 'Begin/End
Custom Method Calls' lines **
'// Begin Wizard Added Variable Intialization
'// End Wizard Added Variable Intialization

InitializeProcCallDataViews()

'// Begin Custom Method Calls
'// End Custom Method Calls
End Sub

Private Sub InitializeProcCallDataViews()

Dim whereClause As String
'// construct Where Clause that will return and empty DataSet
whereClause = "Key1 = '$%' And Key2 = '$%' And Key3 = '$%' And
Key4 = '$%' And Key5 = '$%'"
csm.UpdateProcCallDataView("[UDXX]Adapter","[UDXX]",
whereClause, "[UDXX]View", True)
End Sub
Private Sub Get[UDXX]Record(key1 As String, key2 As String, key3 As
String, key4 As String, key5 As String)
Dim whereClause As String
whereClause = "Key1 = '" & key1 & "' And Key2 = '" & key2 & "' And
Key3 = '" & key3 + "' And Key4 = '" & key4 & "' And Key5 = '" & key5 +
"'"
csm.UpdateProcCallDataView("[UDXX]Adapter","[UDXX]", whereClause,
"[UDXX]View", False)

End Sub

Private Sub [Your Parent View]_AfterRowChange(ByVal args As
EpiRowChangedArgs) Handles [Your Parent View]_Row.EpiRowChanged

Dim Key1 As String =
args.CurrentView.dataView(args.CurrentRow)("[Your Parent View
Field]").ToString()
Dim Key2 As String = String.Empty
Dim Key3 As String = String.Empty
Dim Key4 As String = String.Empty
Dim Key5 As String = String.Empty
Get[UDXX]Record(Key1, Key2, Key3, Key4, Key5)

End Sub

Private Sub [Your Parent View]_DataView_ListChanged(ByVal sender As
Object, ByVal args As ListChangedEventArgs) Handles [Your Parent
View]_DataView.ListChanged

Dim Key1 As String = [Your Parent View]_DataView(0)("[Your Parent
View Field]").ToString()
Dim Key2 As String = String.Empty
Dim Key3 As String = String.Empty
Dim Key4 As String = String.Empty
Dim Key5 As String = String.Empty
Get[UDXX]Record(Key1, Key2, Key3, Key4, Key5)
End Sub

Thanks in advance,
Lynn Thomas
SAIC

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





[Non-text portions of this message have been removed]
Perhaps if you posted your actual code we could maybe spot the error....

--- In vantage@yahoogroups.com, "Lynn Thomas 83" <thomasl@...> wrote:
>
> I'm using 405A on SQL and have a user-defined table that I need to
> connect and use in several places, so that we can keep our colors of
> money separated without too much agony. Help has an article entitled
> "How can a user-defined table become a foreign key view option?"
> Wonderful! That's exactly what I need. I start copying the code as
> directed. I promptly get all sorts of odd errors...definitely NOT
> wonderful.
>
> After a couple days of digging into this, I can't for the life of me
> figure out what's not correct. I've added the necessary assemblies, so
> it's not that. One thing that keeps cropping up is the 'object
> reference not set to an instance of an object', especially with respect
> to the highlighted line. Help?
>
Yes, all the assemblies are there. That error message is actually pretty specific.

--- In vantage@yahoogroups.com, "Rob Bucek" <rbucek@...> wrote:
>
> Lynn,
>
>
>
> Did you add the assembly references? Tools/assembly reference manager.
> Look for the Dll's relating to the UD table you're after (re: AD, BO,
> IF)
>
>
>
> 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 Lynn Thomas 83
> Sent: Thursday, April 23, 2009 8:39 AM
> To: vantage@yahoogroups.com
> Subject: [Vantage] User-Defined Table as FKC
>
>
>
>
>
> I'm using 405A on SQL and have a user-defined table that I need to
> connect and use in several places, so that we can keep our colors of
> money separated without too much agony. Help has an article entitled
> "How can a user-defined table become a foreign key view option?"
> Wonderful! That's exactly what I need. I start copying the code as
> directed. I promptly get all sorts of odd errors...definitely NOT
> wonderful.
>
> After a couple days of digging into this, I can't for the life of me
> figure out what's not correct. I've added the necessary assemblies, so
> it's not that. One thing that keeps cropping up is the 'object
> reference not set to an instance of an object', especially with respect
> to the highlighted line. Help?
>
> Also, can someone tell me what's going on with the objectname_something
> else business? I'm seeing that crop up in lots of these scripts, and
> when it's already there things work fine. When I type it in, not so
> good, but no clue as to exactly what I've missed. In the Read-Only
> version of the code module, I see lots and lots of "ViewName_Column"
> declared as a table, and "ViewName_Row" as a dataview, but only
> "ViewName" in the Object explorer. My reference books don't mention
> this if it's a widely accepted convention, and I'm a long time from my
> programming classes.
>
> The below comes straight from the help doc, with my highlights and some
> white space editing:
>
> Vantage comes with 20 standalone user-defined tables and 11 parent/child
> tables. These special tables let you customize the database so you can
> enter data that is unique to your company. Normally the data entered in
> a user-defined table will be linked to a form using an UltraCombo
> control. This control lets you display your data through a drop-down
> list.
> For more instructions on User-Defined Tables and the UltraCombo control,
> read the User-Defined Tables topic.
> By editing a form's .xml file, however, you can also link a user-defined
> table to a Foreign Key View on the form. You can then access this
> user-defined table from nearly every control within your customization.
> The user-defined table will become available from the Parent View Name
> list within the Custom Data Dialog window.
>
> What to Do
>
> To do this, launch the program in developer mode. Within the
> Customization Tools Dialog, click on the Script Editor tab.
>
> Add the following .xml code (it is displayed below in bold) to the
> form's script. Throughout this script, you will need to substitute the
> following variables:
>
> * [Your Parent View] - substitute this variable with the parent
> view that applies to this form.
> * [Your Parent View Field] - substitute this variable with the
> specific field from your parent view.
> * [UDXX] - substitute this variable with the specific
> user-defined table number - UD03, UD06, UD07, and so on.
> Return to top
>
> UDXX "Foreign Key View" Script
>
> Imports System
> Imports System.Data
> Imports System.Diagnostics
> Imports System.Windows.Forms
> Imports System.ComponentModel
> Imports Epicor.Mfg.UI
> Imports Epicor.Mfg.UI.FrameWork
> Imports Epicor.Mfg.UI.ExtendedProps
> Imports Epicor.Mfg.UI.FormFunctions
> Imports Epicor.Mfg.UI.Customization
>
> Module Script
>
> Private WithEvents [Your Parent View] As DataView
>
> '// ** Wizard Insert Location **
> '// Begin Wizard Added Module Level Variables **
> '// End Wizard Added Module Level Variables **
> '// Add Custom Module Level Variables Here **
>
> Sub InitializeCustomCode()
>
> [Your Parent View]_DataView = [Your Parent View]_Row.dataView
>
> '// ** Wizard Insert Location - Do not delete 'Begin/End
> Custom Method Calls' lines **
> '// Begin Wizard Added Variable Intialization
> '// End Wizard Added Variable Intialization
>
> InitializeProcCallDataViews()
>
> '// Begin Custom Method Calls
> '// End Custom Method Calls
> End Sub
>
> Private Sub InitializeProcCallDataViews()
>
> Dim whereClause As String
> '// construct Where Clause that will return and empty DataSet
> whereClause = "Key1 = '$%' And Key2 = '$%' And Key3 = '$%' And
> Key4 = '$%' And Key5 = '$%'"
> csm.UpdateProcCallDataView("[UDXX]Adapter","[UDXX]",
> whereClause, "[UDXX]View", True)
> End Sub
> Private Sub Get[UDXX]Record(key1 As String, key2 As String, key3 As
> String, key4 As String, key5 As String)
> Dim whereClause As String
> whereClause = "Key1 = '" & key1 & "' And Key2 = '" & key2 & "' And
> Key3 = '" & key3 + "' And Key4 = '" & key4 & "' And Key5 = '" & key5 +
> "'"
> csm.UpdateProcCallDataView("[UDXX]Adapter","[UDXX]", whereClause,
> "[UDXX]View", False)
>
> End Sub
>
> Private Sub [Your Parent View]_AfterRowChange(ByVal args As
> EpiRowChangedArgs) Handles [Your Parent View]_Row.EpiRowChanged
>
> Dim Key1 As String =
> args.CurrentView.dataView(args.CurrentRow)("[Your Parent View
> Field]").ToString()
> Dim Key2 As String = String.Empty
> Dim Key3 As String = String.Empty
> Dim Key4 As String = String.Empty
> Dim Key5 As String = String.Empty
> Get[UDXX]Record(Key1, Key2, Key3, Key4, Key5)
>
> End Sub
>
> Private Sub [Your Parent View]_DataView_ListChanged(ByVal sender As
> Object, ByVal args As ListChangedEventArgs) Handles [Your Parent
> View]_DataView.ListChanged
>
> Dim Key1 As String = [Your Parent View]_DataView(0)("[Your Parent
> View Field]").ToString()
> Dim Key2 As String = String.Empty
> Dim Key3 As String = String.Empty
> Dim Key4 As String = String.Empty
> Dim Key5 As String = String.Empty
> Get[UDXX]Record(Key1, Key2, Key3, Key4, Key5)
> End Sub
>
> Thanks in advance,
> Lynn Thomas
> SAIC
>
> [Non-text portions of this message have been removed]
>
>
>
>
>
> [Non-text portions of this message have been removed]
>