I hear you brother!
Rob
Rob
--- On Mon, 4/6/09, Rob Bucek <rbucek@...> wrote:
From: Rob Bucek <rbucek@...>
Subject: RE: [Vantage] why do i get this error....
To: vantage@yahoogroups.com
Date: Monday, April 6, 2009, 6:23 PM
Never mind, I'm a bone head, *#%*!! typos..... sometimes a guy gets
cross eyed typing and reading this code..
Rob Bucek
Manufacturing Engineer
PH: ext 311
FAX:
<http://www.dsmfg com/>
(Click the logo to view our site)
____________ _________ _________ __
From: vantage@yahoogroups .com [mailto:vantage@yahoogroups .com] On Behalf
Of Rob Bucek
Sent: Monday, April 06, 2009 4:58 PM
To: vantage@yahoogroups .com
Subject: [Vantage] why do i get this error....
Working in the Receiving entry form I am attempting to search for a UD
record, if I do not find the record I want to create a new record. I
have only gotten as far as coding for the creating a new record but when
I save the receipt the I get the following error;
Error Detail
============
Object reference not set to an instance of an object.
Stack Trace
===========
at Script.GetNewUDReco rd()
at Script.UDrecord( )
at Script.oTrans_ receiptAdapter_ AfterAdapterMeth od(Object sender,
AfterAdapterMethodA rgs args)
at Epicor.Mfg.UI. FrameWork. EpiBaseAdapter. OnAfterAdapterMe thod(String
MethodName)
at Epicor.Mfg.UI. Adapters. ReceiptAdapter. CheckDtlBeforeUp date(Int32
vendorNum, String purPoint, Int32 packLine, String packSlip, String&
qMessageStr, String& sMessageStr)
here is my customization (I got a lot of 'stuff' goin on):
Private Sub RcvDtl_AfterFieldCh ange(ByVal sender As object,
ByVal args As DataColumnChangeEve ntArgs) Handles
RcvDtl_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 "VendorQty"
Dim strIUM As String =
edvRcvDtl.DataView( edvRcvDtl. Row)("IUM" )
If strIUM = "SF" Then
Dim edvPart As EpiDataView =
CType(oTrans. EpiDataViews( "Part"), EpiDataView)
Dim edvRcvDtl As EpiDataView =
CType(oTrans. EpiDataViews( "RcvDtl") , EpiDataView)
Dim nbrtags As EpiNumericEditor =
ctype(csm.GetNative ControlReference ("ef040ebc- 3f52-48c7- b199-a73d86679ca
4"),EpiNumericEdito r)
Dim nbrSF As EpiNumericEditor =
ctype(csm.GetNative ControlReference ("449261b6- 618c-4b02- 8b7e-937a9728d8f
d"),EpiNumericEdito r)
Dim nbrArea As Decimal =
edvPart.DataView( edvPart.Row) ("Number01" )
Dim nbrTag As Decimal =
edvRcvDtl.DataView( edvRcvDtl. Row)("Number02" )
Dim nbrQty As Integer =
edvRcvDtl.dataView( edvRcvDtl. Row)("OurQty" )
Dim nbr01 As Decimal =
edvRcvDtl.dataView( edvRcvDtl. Row)("Number01" )
edvRcvDtl.DataView( edvRcvDtl. Row)("Number02" ) = nbrTag
If nbrArea <> 0 Then
'messagebox. show("no part area")
'messagebox. show(nbrarea)
edvRcvDtl.DataView( edvRcvDtl. Row)("Number01" ) =
FormatNumber( nbrQty/nbrArea, 0)
Else
If nbrTag <> 0 Then
'messagebox. show("no part area & area entered within no.01")
'messagebox. show(nbrSF. value)
edvRcvDtl.DataView( edvRcvDtl. Row)("Number01" ) =
FormatNumber( nbrQty/nbrSF. value,0)
Else
messagebox.show( "Please click the save button and then enter
the square foot value for plate size and recheck the Print Labels Check
box.")
chkPrint.Checked = False
'messagebox. show("Please enter Total Square Feet for one
sheet or plate")
nbrSF.focus
End If
End If
End IF
Case "ShortChar01"
Dim Carbon As String = InputBox("Enter carbon content of
Heat Number", "Carbon Content")
'MsgBox("Your Input is " & Carbon)
edvRcvDtl.DataView( edvRcvDtl. Row)("ShortChar0 2") = Carbon
Case Else
End Select
End Sub
Private Sub oTrans_receiptAdapt er_AfterAdapterM ethod(ByVal
sender As object, ByVal args As AfterAdapterMethodA rgs) Handles
oTrans_receiptAdapt er.AfterAdapterM ethod
'// ** Argument Properties and Uses **
'// args.MethodName
'
'Add Event Handler Code
'
'MessageBox. Show(args. MethodName) ' use this to
find method
Select Case args.MethodName
Case "CheckDtlBeforeUpda te"
Dim strIUM As String =
edvRcvDtl.DataView( edvRcvDtl. Row)("IUM" )
'messagebox. show(strIUM)
If strIUM = "SF" Then
Dim edvPart As EpiDataView =
CType(oTrans. EpiDataViews( "Part"), EpiDataView)
Dim edvRcvDtl As EpiDataView =
CType(oTrans. EpiDataViews( "RcvDtl") , EpiDataView)
Dim nbrtags As EpiNumericEditor =
ctype(csm.GetNative ControlReference ("ef040ebc- 3f52-48c7- b199-a73d86679ca
4"),EpiNumericEdito r)
Dim nbrSF As EpiNumericEditor =
ctype(csm.GetNative ControlReference ("449261b6- 618c-4b02- 8b7e-937a9728d8f
d"),EpiNumericEdito r)
Dim nbrArea As Decimal =
edvPart.DataView( edvPart.Row) ("Number01" )
Dim nbrTag As Decimal =
edvRcvDtl.DataView( edvRcvDtl. Row)("Number02" )
Dim nbrQty As Decimal =
edvRcvDtl.dataView( edvRcvDtl. Row)("OurQty" )
Dim nbr01 As Decimal =
edvRcvDtl.dataView( edvRcvDtl. Row)("Number01" )
edvRcvDtl.DataView( edvRcvDtl. Row)("Number02" ) = nbrTag
If nbrArea <> 0 Then
'messagebox. show(nbrSF. value)
'messagebox. show(nbrarea)
edvRcvDtl.DataView( edvRcvDtl. Row)("Number01" ) =
FormatNumber( nbrQty/nbrArea, 0)
UDrecord()
Else
If nbrTag <> 0 Then
'messagebox. show(nbrSF. value)
'messagebox. show(nbrarea)
edvRcvDtl.DataView( edvRcvDtl. Row)("Number01" )=
FormatNumber( nbrQty/nbrSF. value,0)
UDrecord()
Else
messagebox.show( "Please click the save button and then enter
the square foot value for plate size and recheck the Print Labels Check
box.")
chkPrint.Checked = False
'messagebox. show("Please enter Total Square Feet for one
sheet or plate")
nbrSF.focus
End If
End If
End IF
Case Else
End Select
End Sub
Sub UDrecord ()
Dim edvRcvDtl As EpiDataView =
CType(oTrans. EpiDataViews( "RcvDtl") , EpiDataView)
Dim recSelected As Boolean
Dim strHt As String =
edvRcvDtl.DataView( edvRcvDtl. Row)("ShortChar0 2")
Dim whereClause As String = "Key1 = '" + strHt + "'"
Dim dsUD06 As DataSet
dsUD06 =
Epicor.Mfg.UI. FormFunctions. SearchFunctions. listLookup( oTrans,
"UD06Adapter" , recSelected, False, whereClause)
If (recSelected) Then
adaptUD06.GetByID( dsUD06.Tables( 0).Rows(0) ("strHt") ,"","","" ,"")
End If
GetNewUDRecord ()
End Sub
Sub GetNewUDRecord ()
messagebox.show ("get new record")
Dim edvRcvDtl As EpiDataView =
CType(oTrans. EpiDataViews( "RcvDtl") , EpiDataView)
Dim strVen As String =
edvRcvDtl.dataView( edvRcvDtl. Row)("VendorNumN ame")
Dim dteRec As Date =
edvRcvDtl.dataView( edvRcvDtl. Row)("ReceiptDat e")
Dim strPO As String = edvRcvDtl.dataView( edvRcvDtl. Row)("PONum" )
Dim strPart As String =
edvRcvDtl.dataView( edvRcvDtl. Row)("PartNum" )
Dim strHeat As String =
edvRcvDtl.dataView( edvRcvDtl. Row)("ShortChar0 1")
Dim strCarbon As String =
edvRcvDtl.dataView( edvRcvDtl. Row)("ShortChar0 2")
messagebox.show( strCarbon)
Dim adpaptUD06 As UD06Adapter = New
UD06Adapter( ReceiptEntryForm )
adaptUD06.BOConnect ()
adaptUD06.GetaNewUD 06()
adaptUD06.UD06Data. Tables("UD06" ).Rows(0) .BeginEdit( )
adaptUD06.UD06Data. UD06(0)(" Key1" ) = strHeat
adaptUD06.UD06Data. UD06(0)(" Character01" ) = strVen
adaptUD06.UD06Data. Tables("UD06" ).Rows(0) .EndEdit( )
adaptUD06.Update( )
adaptUD06.dispose( )
End Sub
End Module
Rob Bucek
Manufacturing Engineer
PH: ext 311
FAX:
<http://www.dsmfg com/ <http://www.dsmfg com/> >
(Click the logo to view our site)
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]