Page 1 of 1

Unit Of Measure

PostPosted: Wed Jul 31, 2019 2:54 pm
by Ernst
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

Re: Unit Of Measure  Topic is solved

PostPosted: Wed Jul 31, 2019 2:59 pm
by Mike.Sheen
Just set the UnitOfMeasure of the sales order line to be an item in the UnitOfMeasureCollection of the line.

eg - to try and give you something which should work with your code sample (I'm assuming item is a sales order line instance - you like making us guess, don't you?):

Code: Select all
item.UnitOfMeasure = item.UnitOfMeasureCollection(.Sanitise(SQLReader, "UOMRecid"))

Re: Unit Of Measure

PostPosted: Wed Jul 31, 2019 3:04 pm
by Ernst
Now why didnt I think of that...;)

Thanks works a treat.

Re: Unit Of Measure

PostPosted: Wed Jul 31, 2019 3:14 pm
by Ernst
This is a great feature, if you want to sell your items in Packs, but keep them in units. It changes the default UOM to the packs, and the qty will auto change to the multiple of the pack, a bit like the PO system does order units.

Is going to be very useful for customers.

A default tick on the UOM line in a future upgrade, would be great also.

Thanks

Re: Unit Of Measure

PostPosted: Wed Jul 31, 2019 3:23 pm
by Mike.Sheen
Ernst wrote:A default tick on the UOM line in a future upgrade, would be great also.


As UOM's can be configured to be sell, purchase or both - it would probably would be better to have a way of indicating the default sell UOM and default Purchasing UOM - and it's not really going to cut it to put that per UOM in the inventory maintenance as you might also want the default to be the Stock Keeping Unit.

So, I'd suggest two drop-down combo boxes on the Unit Of Measure Tab, next to the Stock Keeping Unit textbox which lists the SKU text and each UOM - one combo for default sell UOM and one for default purchase UOM.

Ernst wrote:This is a great feature, if you want to sell your items in Packs, but keep them in units. It changes the default UOM to the packs, and the qty will auto change to the multiple of the pack, a bit like the PO system does order units.

2016 called, they want their news back.. Unit Of Measure has been in the software for literal years - have you just noticed it?

Re: Unit Of Measure

PostPosted: Wed Jul 31, 2019 3:33 pm
by Ernst
Mike.Sheen wrote:- and it's not really going to cut it to put that per UOM in the inventory maintenance as you might also want the default to be the Stock Keeping Unit.


You could ignore the UOM tab, in which case UOM is Stock Keeping Unit, Or if you wanted to use the UOM tab, Specify the Stock keeping Unit with a Quantity Inner of 1, and Tick that as default sales.
Certainly 2 default would be required.

Mike.Sheen wrote: 2016 called, they want their news back..Unit Of Measure has been in the software for literal years - have you just noticed it?


We only notice things when the customer ask us to do something with it.. ;) I think they have been waiting to see if its going to be a permanent feature, or a fly by night..