Json Datahub message ID : INVQ / queryInventory - mismatch on query

Creation date: 05/12/2024 16:38    Updated: 05/12/2024 16:38   #datahub #messagestructure #primarykey
Question:

Wed 4/12/2024 6:30 PM
Summary of issue/request/query


Kindly to check we are encountering mismatches in the quantity and lines result json by the API for messageId: INVQ / queryInventory when compared to the WMS web UI.

Could you please investigate this issue and help us understand the cause of these discrepancies?



Data testing :


warehouseId : CBT01

customerId : PT.ABC

SKU : 204112


Result from datahub API :


{"Response":{"returnCode":"0000","returnDesc":"Success","returnFlag":"1"},"items":{"item":[{"warehouseId":"CBT01","customerId":"PT.ABC","sku":"204112","qty":0.0,"lotAtt01":"","lotAtt02":"","lotAtt03":"2024-06-11","lotAtt04":"AADS","lotAtt05":"","lotAtt06":"","lotAtt07":"R","lotAtt08":"N","lotAtt09":"","lotAtt10":"","lotAtt11":"","lotAtt12":"","lotAtt13":"","lotAtt15":"","lotAtt16":"","lotAtt17":"","lotAtt18":"","lotAtt19":"","lotAtt20":"","lotAtt21":"","lotAtt22":"","lotAtt23":"","lotAtt24":"","lotnum":"","grossWeight":593.68760331,"netWeight":591.32231405,"cubic":0.03784463,"price":0.0,"userDefine1":"","userDefine2":""},{"warehouseId":"CBT01","customerId":"PT.ABC","sku":"204112","qty":1375.0,"lotAtt01":"","lotAtt02":"","lotAtt03":"2024-06-11","lotAtt04":"AADS","lotAtt05":"","lotAtt06":"","lotAtt07":"R","lotAtt08":"N","lotAtt09":"","lotAtt10":"","lotAtt11":"","lotAtt12":"","lotAtt13":"","lotAtt15":"","lotAtt16":"","lotAtt17":"","lotAtt18":"","lotAtt19":"","lotAtt20":"","lotAtt21":"","lotAtt22":"","lotAtt23":"","lotAtt24":"","lotnum":"","grossWeight":34512.5,"netWeight":34375.0,"cubic":2.2,"price":0.0,"userDefine1":"","userDefine2":""},{"warehouseId":"CBT01","customerId":"PT.ABC","sku":"204112","qty":1325.0,"lotAtt01":"","lotAtt02":"","lotAtt03":"2024-06-11","lotAtt04":"AADS","lotAtt05":"","lotAtt06":"","lotAtt07":"R","lotAtt08":"N","lotAtt09":"","lotAtt10":"","lotAtt11":"","lotAtt12":"","lotAtt13":"","lotAtt15":"","lotAtt16":"","lotAtt17":"","lotAtt18":"","lotAtt19":"","lotAtt20":"","lotAtt21":"","lotAtt22":"","lotAtt23":"","lotAtt24":"","lotnum":"","grossWeight":31465.4429752,"netWeight":31340.08264462,"cubic":2.00576528,"price":0.0,"userDefine1":"","userDefine2":""}]}}




Result from web Ui WMS :


Answer:

make change to which field to use as business keyword to  locationID ,lotnum and traceID  in prod and ask customer to test

After investigation, the reason why only 3 out of 5 lines were displayed is that the 'Whether Business Keyword' option for field warehouseId, customerId, sku, and qty was tick in the message mapping within Datahub.
 ['business keyword' is what used by DTH to identify unique record, like Primary key]

Reason
For the 5 line that was query 2 set of line have the same value for warehouseId, customerId, sku and qty which is why display only 1 line from each set and only a total of 3 line was show in the result.


Fix for this:
change the field that was tick from warehouseIdcustomerIdsku, and qty to locationID ,lotnum and traceid

Causes:
If a query retrieves 10 rows, and the value in all fields marked as 'business keyword' is the same for all 10 rows, only a single row will be displayed.


Potential fix:

 (1) tick other as business keyword

(2)add more field into the query, make it extract more

 

(3)config in Msg Structure-map those field to source from what you extract, but outgoing mapping set to '*'

 
 

log and investigate
Files