PartAdapter issues

Probably some stupid questions:
Â
Why do you need "ToString( )" when the table.field you are reading is already a string field and you are storing it to a string variable?
Â
If your FKV was set up correctly, why are you defining PartView as a DataView versus and EpiDataView? As an Epidataview I don't think you would need all the Row related code and also wouldn't have to force your assumption that row = 0: "PartView_DataView(0)".
Â
Is your assumption that row = 0 correct? Wouldn't this result in an error when you clear job entry and no record is loaded?
Â
Rob Brown
Â


--- On Fri, 9/19/08, Ross Hughes <ross.hughes@...> wrote:

From: Ross Hughes <ross.hughes@...>
Subject: [Vantage] Re: PartAdapter issues
To: vantage@yahoogroups.com
Date: Friday, September 19, 2008, 10:33 AM






I am having a similar problem to this. I made a part master
customization and now want to be able to connect this to Job Entry.
It started with experiencing the limited field set in PartList.

Bernie, I followed your lead but I end up with an error "Index 0 is
either negative or above rows count". I have created a FKV - Part
View
called 'PartView'.

My code is below:
------------ -----
'//********* ********* ********* ********* ********* *****
'// Custom VB.NET code for JobEntryForm
'// Created: 2/29/2008 7:54:28 AM
'//********* ********* ********* ********* ********* *****
Imports System
Imports System.Data
Imports System.Diagnostics
Imports System.Windows. Forms
Imports System.ComponentMod el
Imports Microsoft.VisualBas ic
Imports Epicor.Mfg.UI
Imports Epicor.Mfg.UI. FrameWork
Imports Epicor.Mfg.UI. ExtendedProps
Imports Epicor.Mfg.UI. FormFunctions
Imports Epicor.Mfg.UI. Customization
Imports Epicor.Mfg.UI. Adapters
Imports Epicor.Mfg.UI. Searches
Imports Epicor.Mfg.BO

Module Script

'// ** Wizard Insert Location - Do Not Remove 'Begin/End
Wizard Added Module Level Variables' Comments! **
'// Begin Wizard Added Module Level Variables **

'// End Wizard Added Module Level Variables **

'// Add Custom Module Level Variables Here **

Private WithEvents PartView_DataView As DataView

Sub InitializeCustomCod e()

PartView_DataView = PartView_Row. dataView

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

'// End Wizard Added Variable Intialization
'// Begin Custom Method Calls

'// End Custom Method Calls
End Sub

Sub DestroyCustomCode( )

'// ** Wizard Insert Location - Do not
delete 'Begin/End Wizard Added Object Disposal' lines **
'// Begin Wizard Added Object Disposal

'// End Wizard Added Object Disposal
'// Begin Custom Code Disposal

'// End Custom Code Disposal
End Sub


Private Sub JobHead_AfterFieldC hange(ByVal sender As object,
ByVal args As DataColumnChangeEve ntArgs) Handles
JobHead_Column. ColumnChanged
'// ** Argument Properties and Uses **
'// args.Row("[FieldNam e]")
'// args.Column, args.ProposedValue, args.Row
'
'Add Event Handler Code
'
Select Case args.Column. ColumnName

Case "PartNum"

Dim edv As EpiDataView = CType(oTrans. EpiDataViews
("JobHead"), EpiDataView)

Dim customerid As String = PartView_DataView( 0)
("ShortChar05" ).ToString( )
Dim customername As String = PartView_DataView( 0)
("Character02" ).ToString( )

MessageBox.Show( customerid)

'If customerid <> "" Then
'edv.dataView( edv.Row)( "ShortChar01" ) =
customerid 'Adding the CustID from the part master
'edv.dataView( edv.Row)( "Character01" ) =
customername 'Adding the Customer Name from part master
'edv.Notify( New EpiNotifyArgs( oTrans,
edv.Row, edv.Column) )
'Else
' edv.dataView( edv.Row)( "ShortChar01" ) = ""
' edv.dataView( edv.Row)( "Character01" ) = ""
' edv.Notify( New EpiNotifyArgs( oTrans,
edv.Row, edv.Column) )
'End If


Case Else

End Select

End Sub


End Module
------------ ---------

Am I using the wrong event? A sequence thing? As soon as I enter
the 'ToString' code lines I get the error.

Thanks,
Ross

--- In vantage@yahoogroups .com, "fonsvanderbeek"
<fons.vanderbeek@ ...> wrote:
>
> Thanx very much!!!
> It worked!
>
> The particular form was "receipt entry", I needed to look up wether
> the received part existed in parts and if true, retrieve a
> customfield and print this to a label (dymo printer)
>
> --- In vantage@yahoogroups .com, Bernie Walker <bwalker@> wrote:
> >
> > The PartList dataset is a very limited set of fields and does not
> contain any of the user defined fields.
> >
> > The simplest way would be use the data tools screen to add a
> Foreign Key View (FKV) to the part table.
> > (As long as the form you are using has a table that will link to
> the part table)
> > Then add a custom module variable:
> >
> > Private WithEvents PartView_DataView As DataView
> >
> > In the InitializeCustomCod e procedure:
> >
> > PartView_DataView = PartView_Row. dataView
> >
> > Now anytime the PartNum changes in your base form, the data is
> automatically updated in the PartView
> > You can reference the part info by:
> >
> > PartView_DataView( 0)("Character01" ).ToString( )
> >
> > Without knowing the form you are customizing, it is difficult to
> tell if this will work for you...
> >
> > Bernie.
> >
> > -----Original Message-----
> > From: vantage@yahoogroups .com [mailto:vantage@yahoogroups .com] On
> Behalf Of fonsvanderbeek
> > Sent: Tuesday, August 07, 2007 5:15 AM
> > To: vantage@yahoogroups .com
> > Subject: [Vantage] PartAdapter issues
> >
> > I am trying to retrieve the value of the "Character01" field
> >
> > The code I use is:
> >
> > cWhereClause = "Company = '" + CurCompany + "' And
> PartNum='"+PartNumV ar+"'"
> >
> > dsSearch = Epicor.Mfg.UI. FormFunctions. SearchFunctions. listlookup
> > (oTrans, "PartAdapter" , lRecSelected, true,
> > cWhereClause, false,"Part" )
> >
> > if lRecSelected
> > PurchcodeVar= trim(dsSearch. Tables(0) .Rows(0)( "Character01" )
> > +"."+dsSearch. Tables(0) .Rows(0)( "Character02" ))
> > else
> > PurchcodeVar= ""
> > end if
> >
> > But the I can't retrieve "Character01" : the error message is
> >
> > "Column Character01 doesnot belong to table PartList"
> >
> > What am i doing wrong?????
> >
> > I also tried using
> > "dsSearch = Epicor.Mfg.UI. FormFunctions. SearchFunctions. listlookup
> > (oTrans, "PartAdapter" , lRecSelected, true, cWhereClause) "
> > With the same result...... .....
> >
> > Can someone point me in the right direction?
> >
> >
> >
> > 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/ links
> > Yahoo! Groups Links
> >
>


















[Non-text portions of this message have been removed]
I am trying to retrieve the value of the "Character01" field

The code I use is:

cWhereClause = "Company = '" + CurCompany + "' And
PartNum='"+PartNumVar+"'"

dsSearch = Epicor.Mfg.UI.FormFunctions.SearchFunctions.listlookup
(oTrans, "PartAdapter", lRecSelected,true,
cWhereClause,false,"Part")

if lRecSelected
PurchcodeVar=trim(dsSearch.Tables(0).Rows(0)("Character01")
+"."+dsSearch.Tables(0).Rows(0)("Character02"))
else
PurchcodeVar=""
end if

But the I can't retrieve "Character01": the error message is

"Column Character01 doesnot belong to table PartList"

What am i doing wrong?????

I also tried using
"dsSearch = Epicor.Mfg.UI.FormFunctions.SearchFunctions.listlookup
(oTrans, "PartAdapter", lRecSelected,true, cWhereClause)"
With the same result...........

Can someone point me in the right direction?
The PartList dataset is a very limited set of fields and does not contain any of the user defined fields.

The simplest way would be use the data tools screen to add a Foreign Key View (FKV) to the part table.
(As long as the form you are using has a table that will link to the part table)
Then add a custom module variable:

Private WithEvents PartView_DataView As DataView

In the InitializeCustomCode procedure:

PartView_DataView = PartView_Row.dataView

Now anytime the PartNum changes in your base form, the data is automatically updated in the PartView
You can reference the part info by:

PartView_DataView(0)("Character01").ToString()

Without knowing the form you are customizing, it is difficult to tell if this will work for you...

Bernie.

-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of fonsvanderbeek
Sent: Tuesday, August 07, 2007 5:15 AM
To: vantage@yahoogroups.com
Subject: [Vantage] PartAdapter issues

I am trying to retrieve the value of the "Character01" field

The code I use is:

cWhereClause = "Company = '" + CurCompany + "' And PartNum='"+PartNumVar+"'"

dsSearch = Epicor.Mfg.UI.FormFunctions.SearchFunctions.listlookup
(oTrans, "PartAdapter", lRecSelected,true,
cWhereClause,false,"Part")

if lRecSelected
PurchcodeVar=trim(dsSearch.Tables(0).Rows(0)("Character01")
+"."+dsSearch.Tables(0).Rows(0)("Character02"))
else
PurchcodeVar=""
end if

But the I can't retrieve "Character01": the error message is

"Column Character01 doesnot belong to table PartList"

What am i doing wrong?????

I also tried using
"dsSearch = Epicor.Mfg.UI.FormFunctions.SearchFunctions.listlookup
(oTrans, "PartAdapter", lRecSelected,true, cWhereClause)"
With the same result...........

Can someone point me in the right direction?



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/links
Yahoo! Groups Links
Thanx very much!!!
It worked!

The particular form was "receipt entry", I needed to look up wether
the received part existed in parts and if true, retrieve a
customfield and print this to a label (dymo printer)

--- In vantage@yahoogroups.com, Bernie Walker <bwalker@...> wrote:
>
> The PartList dataset is a very limited set of fields and does not
contain any of the user defined fields.
>
> The simplest way would be use the data tools screen to add a
Foreign Key View (FKV) to the part table.
> (As long as the form you are using has a table that will link to
the part table)
> Then add a custom module variable:
>
> Private WithEvents PartView_DataView As DataView
>
> In the InitializeCustomCode procedure:
>
> PartView_DataView = PartView_Row.dataView
>
> Now anytime the PartNum changes in your base form, the data is
automatically updated in the PartView
> You can reference the part info by:
>
> PartView_DataView(0)("Character01").ToString()
>
> Without knowing the form you are customizing, it is difficult to
tell if this will work for you...
>
> Bernie.
>
> -----Original Message-----
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On
Behalf Of fonsvanderbeek
> Sent: Tuesday, August 07, 2007 5:15 AM
> To: vantage@yahoogroups.com
> Subject: [Vantage] PartAdapter issues
>
> I am trying to retrieve the value of the "Character01" field
>
> The code I use is:
>
> cWhereClause = "Company = '" + CurCompany + "' And
PartNum='"+PartNumVar+"'"
>
> dsSearch = Epicor.Mfg.UI.FormFunctions.SearchFunctions.listlookup
> (oTrans, "PartAdapter", lRecSelected,true,
> cWhereClause,false,"Part")
>
> if lRecSelected
> PurchcodeVar=trim(dsSearch.Tables(0).Rows(0)("Character01")
> +"."+dsSearch.Tables(0).Rows(0)("Character02"))
> else
> PurchcodeVar=""
> end if
>
> But the I can't retrieve "Character01": the error message is
>
> "Column Character01 doesnot belong to table PartList"
>
> What am i doing wrong?????
>
> I also tried using
> "dsSearch = Epicor.Mfg.UI.FormFunctions.SearchFunctions.listlookup
> (oTrans, "PartAdapter", lRecSelected,true, cWhereClause)"
> With the same result...........
>
> Can someone point me in the right direction?
>
>
>
> 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/links
> Yahoo! Groups Links
>
I am having a similar problem to this. I made a part master
customization and now want to be able to connect this to Job Entry.
It started with experiencing the limited field set in PartList.

Bernie, I followed your lead but I end up with an error "Index 0 is
either negative or above rows count". I have created a FKV - Part
View
called 'PartView'.

My code is below:
-----------------
'//**************************************************
'// Custom VB.NET code for JobEntryForm
'// Created: 2/29/2008 7:54:28 AM
'//**************************************************
Imports System
Imports System.Data
Imports System.Diagnostics
Imports System.Windows.Forms
Imports System.ComponentModel
Imports Microsoft.VisualBasic
Imports Epicor.Mfg.UI
Imports Epicor.Mfg.UI.FrameWork
Imports Epicor.Mfg.UI.ExtendedProps
Imports Epicor.Mfg.UI.FormFunctions
Imports Epicor.Mfg.UI.Customization
Imports Epicor.Mfg.UI.Adapters
Imports Epicor.Mfg.UI.Searches
Imports Epicor.Mfg.BO


Module Script


'// ** Wizard Insert Location - Do Not Remove 'Begin/End
Wizard Added Module Level Variables' Comments! **
'// Begin Wizard Added Module Level Variables **


'// End Wizard Added Module Level Variables **


'// Add Custom Module Level Variables Here **

Private WithEvents PartView_DataView As DataView

Sub InitializeCustomCode()

PartView_DataView = PartView_Row.dataView

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

'// End Wizard Added Variable Intialization
'// Begin Custom Method Calls

'// End Custom Method Calls
End Sub



Sub DestroyCustomCode()


'// ** Wizard Insert Location - Do not
delete 'Begin/End Wizard Added Object Disposal' lines **
'// Begin Wizard Added Object Disposal

'// End Wizard Added Object Disposal
'// Begin Custom Code Disposal

'// End Custom Code Disposal
End Sub


Private Sub JobHead_AfterFieldChange(ByVal sender As object,
ByVal args As DataColumnChangeEventArgs) Handles
JobHead_Column.ColumnChanged
'// ** Argument Properties and Uses **
'// args.Row("[FieldName]")
'// args.Column, args.ProposedValue, args.Row
'
'Add Event Handler Code
'
Select Case args.Column.ColumnName

Case "PartNum"

Dim edv As EpiDataView = CType(oTrans.EpiDataViews
("JobHead"), EpiDataView)

Dim customerid As String = PartView_DataView(0)
("ShortChar05").ToString()
Dim customername As String = PartView_DataView(0)
("Character02").ToString()

MessageBox.Show(customerid)

'If customerid <> "" Then
'edv.dataView(edv.Row)("ShortChar01") =
customerid 'Adding the CustID from the part master
'edv.dataView(edv.Row)("Character01") =
customername 'Adding the Customer Name from part master
'edv.Notify( New EpiNotifyArgs(oTrans,
edv.Row, edv.Column) )
'Else
' edv.dataView(edv.Row)("ShortChar01") = ""
' edv.dataView(edv.Row)("Character01") = ""
' edv.Notify( New EpiNotifyArgs(oTrans,
edv.Row, edv.Column) )
'End If


Case Else

End Select

End Sub



End Module
---------------------

Am I using the wrong event? A sequence thing? As soon as I enter
the 'ToString' code lines I get the error.

Thanks,
Ross


--- In vantage@yahoogroups.com, "fonsvanderbeek"
<fons.vanderbeek@...> wrote:
>
> Thanx very much!!!
> It worked!
>
> The particular form was "receipt entry", I needed to look up wether
> the received part existed in parts and if true, retrieve a
> customfield and print this to a label (dymo printer)
>
> --- In vantage@yahoogroups.com, Bernie Walker <bwalker@> wrote:
> >
> > The PartList dataset is a very limited set of fields and does not
> contain any of the user defined fields.
> >
> > The simplest way would be use the data tools screen to add a
> Foreign Key View (FKV) to the part table.
> > (As long as the form you are using has a table that will link to
> the part table)
> > Then add a custom module variable:
> >
> > Private WithEvents PartView_DataView As DataView
> >
> > In the InitializeCustomCode procedure:
> >
> > PartView_DataView = PartView_Row.dataView
> >
> > Now anytime the PartNum changes in your base form, the data is
> automatically updated in the PartView
> > You can reference the part info by:
> >
> > PartView_DataView(0)("Character01").ToString()
> >
> > Without knowing the form you are customizing, it is difficult to
> tell if this will work for you...
> >
> > Bernie.
> >
> > -----Original Message-----
> > From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On
> Behalf Of fonsvanderbeek
> > Sent: Tuesday, August 07, 2007 5:15 AM
> > To: vantage@yahoogroups.com
> > Subject: [Vantage] PartAdapter issues
> >
> > I am trying to retrieve the value of the "Character01" field
> >
> > The code I use is:
> >
> > cWhereClause = "Company = '" + CurCompany + "' And
> PartNum='"+PartNumVar+"'"
> >
> > dsSearch = Epicor.Mfg.UI.FormFunctions.SearchFunctions.listlookup
> > (oTrans, "PartAdapter", lRecSelected,true,
> > cWhereClause,false,"Part")
> >
> > if lRecSelected
> > PurchcodeVar=trim(dsSearch.Tables(0).Rows(0)("Character01")
> > +"."+dsSearch.Tables(0).Rows(0)("Character02"))
> > else
> > PurchcodeVar=""
> > end if
> >
> > But the I can't retrieve "Character01": the error message is
> >
> > "Column Character01 doesnot belong to table PartList"
> >
> > What am i doing wrong?????
> >
> > I also tried using
> > "dsSearch = Epicor.Mfg.UI.FormFunctions.SearchFunctions.listlookup
> > (oTrans, "PartAdapter", lRecSelected,true, cWhereClause)"
> > With the same result...........
> >
> > Can someone point me in the right direction?
> >
> >
> >
> > 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/links
> > Yahoo! Groups Links
> >
>