Am trying to default the Unit of Measure to a different value in the sales order line add plugin in JIWA 7.02.
Had coded below, But does not seem I can assign the recid so easily. Do I need to do something with the collection to get this to work..
Thanks for help.
' Check For Default Unit Of Measure.....
With Item.Manager.Database
Dim SQL As String = "select top 1 Ltrim(recid) as UOMRecid from IN_UnitOfMeasure where IN_Main_InventoryID = '" & Item.InventoryID & "' and PartNo = 'DEFAULT' "
Dim SQLReader As SqlDataReader = Nothing
' Dim SQLParam As SqlParameter
'
Using SQLCmd = New SqlCommand(SQL, .SQLConnection, .SQLTransaction)
'
Try
SQLReader = SQLCmd.ExecuteReader()
'
If SQLReader.Read = True Then
msgbox( .Sanitise(SQLReader, "UOMRecid"))
Item.UnitOfMeasure.Recid = .Sanitise(SQLReader, "UOMRecid")
Else
End If
'
Finally
If Not SQLReader Is Nothing Then
SQLReader.Close()
SQLReader = Nothing
End If
End Try
End Using
'
End With