Solution:

  1. Go to Stocks > Stock Items > Search
  2. Select Edit and click ‘Scan UOM’
  3. On the result, take note / mark down of those Stock Code that missing UOM.
  4. Click Auto Fix
  5. Obtain script from Appendix 1 or below link

https://drive.google.com/open?id=0BzrrsMUq-H6gRFpfTDZaYmE4czA

  1. Replace STOCK-001 with the Stock Code that missing UOM

update QuotationDetails

set uomid=(select id from uoms where stockid=(select id from stocks where

stockcode='STOCK-001'))--Replace STOCK-001 with the Stock Code that missing UOM--

where stockid in(select id from stocks where

stockcode =('STOCK-001'))--Replace STOCK-001 with the Stock Code that missing UOM—

CHANGE TO >>

update QuotationDetails

set uomid=(select id from uoms where stockid=(select id from stocks where

stockcode='DT-RD001-THC'))--Replace STOCK-001 with the Stock Code that missing UOM--

where stockid in(select id from stocks where

stockcode =('DT-RD001-THC'))--Replace STOCK-001 with the Stock Code that missing UOM--

 

  1. Repeat step No. 6 if more than 1 Stock’s UOM missing.

Appendix 1 (https://drive.google.com/open?id=0BzrrsMUq-H6gRFpfTDZaYmE4czA)