CustID on Part Entry

Yes, more complicated then needed.

I took that example from an advanced customization doc from Epicor
(below). It does work as listed in the part master.

It looks like their approach is taking a view and modifying the
database and refreshing the textbox values, rather than just entering
the
data in the textbox and letting the interface manage the rest. Maybe
I am missing something.

Your line worked perfectly.

Thanks so much,
Ross

----------
Dim recSelected As Boolean
Dim whereClause As String = String.Empty
Dim dsPart As DataSet =
Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup
(oTrans, "PartAdapter", recSelected, True, whereClause)
If (recSelected) Then
Dim edv As EpiDataView = CType(oTrans.EpiDataViews
("ViewName"), EpiDataView)

edv.dataView(edv.Row)("Character01") = dsPart.Tables
(0).Rows(0)("PartNum")
edv.dataView(edv.Row)("Character02") = dsPart.Tables
(0).Rows(0)("PartDescription")
edv.Notify( New EpiNotifyArgs(oTrans, edv.Row,
edv.Column) )
End If
-----------


--- In vantage@yahoogroups.com, "bw2868bond" <bwalker@...> wrote:
>
> I am not sure exactly what you are trying to accomplish with this:
>
> > Dim edv As EpiDataView = CType(oTrans.EpiDataViews("Customer"),
> > EpiDataView)
> > edv.dataView(edv.Row)("Character01") = dsCustomer.Tables(0).Rows
(0)
> > ("CustID")
> > edv.Notify( New EpiNotifyArgs(oTrans, edv.Row, edv.Column) )
>
> If you have a text box that is bound to a field in the part table,
> then all you would need to do is:
>
> txtEpiCustom1.Text = dsCustomer.Tables(0).Rows(0)("CustID")
>
> bw
>
> --- In vantage@yahoogroups.com, "Ross Hughes" <ross.hughes@> wrote:
> >
> > Hello,
> >
> > I am trying to add a CustID field to the part master. I have
added
> > it and bound a Character field to the text box. That all works
> OK.
> >
> > Then I am calling the customer search box with some code. (listed
> > below). I have also added the 3 customer.dll files as custom
> > references.
> >
> > When I select the customer from the search box (in hopes of
> returning
> > the CustID), I get the following hard error:
> >
> > "Object reference not set to an instance of an object". This
seems
> > like it might be related to the Customer DataView not being
> > accessible or properly declared.
> >
> > Can anyone help?
> >
> > Thanks much,
> > Ross
> >
> > ------------------------------------
> > Private Sub btnCUSTID_Click(ByVal Sender As Object, ByVal Args As
> > System.EventArgs) Handles btnCUSTID.Click
> >
> > '// ** Place Event Handling Code Here **
> >
> > Dim recSelected As Boolean
> > Dim whereClause As String = String.Empty
> > Dim dsCustomer As DataSet =
> > Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup
> > (oTrans, "CustomerAdapter", recSelected, True, whereClause)
> >
> > If (recSelected) Then
> >
> > Dim edv As EpiDataView = CType(oTrans.EpiDataViews("Customer"),
> > EpiDataView)
> > edv.dataView(edv.Row)("Character01") = dsCustomer.Tables(0).Rows
(0)
> > ("CustID")
> > edv.Notify( New EpiNotifyArgs(oTrans, edv.Row, edv.Column) )
> >
> > End If
> >
> > End Sub
> >
>
Hello,

I am trying to add a CustID field to the part master. I have added
it and bound a Character field to the text box. That all works OK.

Then I am calling the customer search box with some code. (listed
below). I have also added the 3 customer.dll files as custom
references.

When I select the customer from the search box (in hopes of returning
the CustID), I get the following hard error:

"Object reference not set to an instance of an object". This seems
like it might be related to the Customer DataView not being
accessible or properly declared.

Can anyone help?

Thanks much,
Ross

------------------------------------
Private Sub btnCUSTID_Click(ByVal Sender As Object, ByVal Args As
System.EventArgs) Handles btnCUSTID.Click

'// ** Place Event Handling Code Here **

Dim recSelected As Boolean
Dim whereClause As String = String.Empty
Dim dsCustomer As DataSet =
Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup
(oTrans, "CustomerAdapter", recSelected, True, whereClause)

If (recSelected) Then

Dim edv As EpiDataView = CType(oTrans.EpiDataViews("Customer"),
EpiDataView)
edv.dataView(edv.Row)("Character01") = dsCustomer.Tables(0).Rows(0)
("CustID")
edv.Notify( New EpiNotifyArgs(oTrans, edv.Row, edv.Column) )

End If

End Sub
I believe using the customer adapter would make it easier. Make the
field a Ultra Combo and use the customer adapter to get the customer
drop down list. Bind the combo box to the Character (or ShortCharacter)
field. The ultra combo will display the customer name while storing the
customer ID in the db field.



Do the same thing in the part tracker and the UCB will always display
the customer name.



I did the same thing using employees so that the part engineer could be
identified by part.



Charlie Smith

2W Technologies LLC / Smith Business Services





From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Ross Hughes
Sent: Thursday, May 15, 2008 1:51 PM
To: vantage@yahoogroups.com
Subject: [Vantage] CustID on Part Entry



Hello,

I am trying to add a CustID field to the part master. I have added
it and bound a Character field to the text box. That all works OK.

Then I am calling the customer search box with some code. (listed
below). I have also added the 3 customer.dll files as custom
references.

When I select the customer from the search box (in hopes of returning
the CustID), I get the following hard error:

"Object reference not set to an instance of an object". This seems
like it might be related to the Customer DataView not being
accessible or properly declared.

Can anyone help?

Thanks much,
Ross

------------------------------------
Private Sub btnCUSTID_Click(ByVal Sender As Object, ByVal Args As
System.EventArgs) Handles btnCUSTID.Click

'// ** Place Event Handling Code Here **

Dim recSelected As Boolean
Dim whereClause As String = String.Empty
Dim dsCustomer As DataSet =
Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup
(oTrans, "CustomerAdapter", recSelected, True, whereClause)

If (recSelected) Then

Dim edv As EpiDataView = CType(oTrans.EpiDataViews("Customer"),
EpiDataView)
edv.dataView(edv.Row)("Character01") = dsCustomer.Tables(0).Rows(0)
("CustID")
edv.Notify( New EpiNotifyArgs(oTrans, edv.Row, edv.Column) )

End If

End Sub





[Non-text portions of this message have been removed]
I am not sure exactly what you are trying to accomplish with this:

> Dim edv As EpiDataView = CType(oTrans.EpiDataViews("Customer"),
> EpiDataView)
> edv.dataView(edv.Row)("Character01") = dsCustomer.Tables(0).Rows(0)
> ("CustID")
> edv.Notify( New EpiNotifyArgs(oTrans, edv.Row, edv.Column) )

If you have a text box that is bound to a field in the part table,
then all you would need to do is:

txtEpiCustom1.Text = dsCustomer.Tables(0).Rows(0)("CustID")

bw

--- In vantage@yahoogroups.com, "Ross Hughes" <ross.hughes@...> wrote:
>
> Hello,
>
> I am trying to add a CustID field to the part master. I have added
> it and bound a Character field to the text box. That all works
OK.
>
> Then I am calling the customer search box with some code. (listed
> below). I have also added the 3 customer.dll files as custom
> references.
>
> When I select the customer from the search box (in hopes of
returning
> the CustID), I get the following hard error:
>
> "Object reference not set to an instance of an object". This seems
> like it might be related to the Customer DataView not being
> accessible or properly declared.
>
> Can anyone help?
>
> Thanks much,
> Ross
>
> ------------------------------------
> Private Sub btnCUSTID_Click(ByVal Sender As Object, ByVal Args As
> System.EventArgs) Handles btnCUSTID.Click
>
> '// ** Place Event Handling Code Here **
>
> Dim recSelected As Boolean
> Dim whereClause As String = String.Empty
> Dim dsCustomer As DataSet =
> Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup
> (oTrans, "CustomerAdapter", recSelected, True, whereClause)
>
> If (recSelected) Then
>
> Dim edv As EpiDataView = CType(oTrans.EpiDataViews("Customer"),
> EpiDataView)
> edv.dataView(edv.Row)("Character01") = dsCustomer.Tables(0).Rows(0)
> ("CustID")
> edv.Notify( New EpiNotifyArgs(oTrans, edv.Row, edv.Column) )
>
> End If
>
> End Sub
>