Good day everyone,
I am creating a form, which will be used for matching purchase and sales line.
This form needs to present the list of matching purchase candidates for a SalesLine comparing quantity with purchase lines.
From sales order form we can select the sales line and then click menu action button to open my form show matchable candidates.
This is a form with a grid and behind it is a query with a PurchLine as a main datasource.
The matching is done using quantity, when SalesLine.SalesQty == PurchLine.PurchQty we need to show this line, but, of course, lines can have different units and we need to implement unit conversion there.
For sales line with 100 * UnitId kilograms the form should show all PurchLines candidates which have 100 kg or even 0.1 ton or even 100 000 grams.
And that is a problem I do not know how to add the convertion to my form.
Unfortunatelly we need performance and we cannot use some Tmp table which we would pre-fill upon openning with converted values.
Is there any option how I can tell SQL to do the magic for me using Computed Columns or join some View which will convert all quantities to the UnitId I specify?
Or simply: Can I do the unit convertion using Computed column?