I have a secondary part number in a custom sheet in part maintenance. I’ve made it “like” the PartNum field, so it lets me Open With part search, but I don’t have a way to validate it when someone enters a part manually.
I also want it to display the part description in another field.
Anyone have a bit o’ code you’d be willing to part with?
Here is a bit in VB that you can convert if needed.
Ross
Private Sub txtSecondPart_Validating(ByVal Sender As Object, ByVal Args As System.ComponentModel.CancelEventArgs) Handles txtSecondPart.Validating
'// ** Place Event Handling Code Here **
Dim edv As EpiDataView = CType(oTrans.EpiDataViews(“Part”), EpiDataView)
Dim recSelected As Boolean
Dim whereClause As String = "PartNum = '" & txtSecondPart.Text & "'"
Dim dsPart As DataSet = Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup(oTrans, "PartAdapter", recSelected, False, whereClause)
If (recSelected) Then
edv.dataView(edv.Row)(“ShortChar05”) = 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) )
Else If txtSecondPart.Text = ""
edv.dataView(edv.Row)(“ShortChar05”) = ""
edv.dataView(edv.Row)(“Character02”) = ""
Else
MessageBox.Show("'" & txtSecondPart.Text & "'" & " is not a valid part number.")
edv.dataView(edv.Row)(“ShortChar05”) = ""
edv.dataView(edv.Row)(“Character02”) = ""
txtSecondPart.Focus()
End If
End Sub