Solved

API "One or more lines have unassigned Location and/or Lot/Serial Number" when creating an issue

  • 16 October 2023
  • 13 replies
  • 149 views

Userlevel 1

When I create an issue through the UI, it works. I try to do the same thing through the API, and I get the error noted in the subject. Here’s the full payload i PUT to /entity/Default/22.200.001/InventoryIssue

 

this is only problematic when the stock item requires a lot number. I want to pass that & not able to through the API

 

payload = {
"Note": {
"value": "test"
},
"Details": [
{
"InventoryID": {
"value": "GEN-10127"
},
"Note": {
"value": "VO 109044, VOI 123872"
},
"LotSerialNbr": {
"value": "64980051405"
},
"WarehouseID": {
"value": "TP-NY"
},
"Location": {
"value": "TP-NY"
},
"Qty": {
"value": "1",
},
"TranType": {
"value": "Issue"
},
"UnitPrice": {
"value": 3.52
},
"UOM": {
"value": "BOTTLE"
},
"ReasonCode": {
"value": "TPISSUE"
}
}
],
"PostPeriod": {
"value": "10-2023"
},
"Date": {
"value": "2023-10-12"
},
}

Here’s the response I get back, note that the LotSerialNbr does not come back, as if it was filtered pre-processing in Acumatica

 

 

{
"ControlAmount": {
"value": 3.52
},
"ControlQty": {
"value": 1.0
},
"Date": {
"value": "2023-10-12T00:00:00+00:00"
},
"Description": {},
"Details": [
{
"Branch": {
"value": "VETCOVE"
},
"Description": {
"value": "Timolol Maleate Ophthalmic Solution 0.50% 5mL Bottle"
},
"ExpirationDate": {},
"ExtCost": {
"value": 0.0
},
"ExtPrice": {
"value": 3.52
},
"InventoryID": {
"value": "GEN-10127"
},
"LineNumber": {
"value": 1
},
"Location": {
"value": "TP-NY"
},
"LotSerialNbr": {
"value": ""
},
"Qty": {
"error": "One or more lines have unassigned Location and/or Lot/Serial Number",
"value": 1.0
},
"ReasonCode": {
"value": "TPISSUE"
},
"TranType": {
"value": "Issue"
},
"UOM": {
"value": "BOTTLE"
},
"UnitCost": {
"value": 0.0
},
"UnitPrice": {
"value": 3.52
},
"WarehouseID": {
"value": "TP-NY"
},
"_links": {
"files:put": "/entity/Default/22.200.001/files/PX.Objects.IN.INIssueEntry/transactions/b4fddece-576c-ee11-834d-124ed9a423ab/{filename}"
},
"custom": {},
"id": "b4fddece-576c-ee11-834d-124ed9a423ab",
"note": {
"value": "VO 109044, VOI 123872"
},
"rowNumber": 1
}
],
"ExternalRef": {},
"PostPeriod": {
"value": "102023"
},
"ReferenceNbr": {
"value": "<NEW>"
},
"Status": {
"value": "Balanced"
},
"TotalAmount": {
"value": 3.52
},
"TotalCost": {
"value": 0.0
},
"TotalQty": {
"value": 1.0
},
"_links": {
"files:put": "<deleted>",
"self": "<deleted>"
},
"custom": {},
"error": "Inserting IN Transaction record raised at least one error. Please review the errors.",
"id": "b1fddece-576c-ee11-834d-124ed9a423ab",
"note": {
"value": "test"
},
"rowNumber": 1
}
icon

Best answer by Vignesh Ponnusamy 17 October 2023, 16:37

View original

13 replies

Userlevel 7
Badge +4

@mikebar98 

If you are able to perform this transaction with the same data in UI, I dont see why it would error out in API. If thats the case, could be a bug how API is handling the transaction, and I would suggest opening a DEV support ticket for further review and bug fix if required.

However, have you looked up the error message. I found following community discussion that might be helpful:

ERROR: One or more lines have unassigned Location and/or Lot/Serial Number | Community (acumatica.com)

Userlevel 7
Badge +4

Hi @mikebar98,

You can try following payload structure to include the Lot/Serial Number in the request. This will allow you to specify LotSerialNbr for each InventoryID/detail line you add.

{
"Description": {
"value": "From API"
},
"Details": [
{
"InventoryID": {
"value": "AAPOWERAID"
},
"Allocations": [
{
"Location": {
"value": "R1S1"
},
"LotSerialNbr": {
"value": "LREX15026"
},
"Qty": {
"value": 20.000000
}
}
]
}
]
}

Hope that helps.! Feel free to post if you have any questions. Good Luck.!

Userlevel 5
Badge

I believe what @Vignesh Ponnusamy created should help you solve your issue.

Userlevel 1

Thank you @Vignesh Ponnusamy, this was it!

Is there some API doc that I’m missing? I thought I looked everywhere for inventory issue pushing, didn’t see this allocation key. 

Userlevel 7
Badge +4

Hi @mikebar98,

Glad that helps.! 

It is possible that we don’t have example for all the endpoint entity but you should be able to locate documentation similar to this screen/functionality. For example, below are a two example of creating allocations from the API,

Cheers.!

Userlevel 1

Hi team, following up here
 

 

it seems that the UOM i specify during the allocation (which matches the UOM i specify on the top level) is being ignored. The default UOM is being assumed (which is incorrectly converting the qty i specify in the allocation).

 

Is that expected? I believe im passing the UOM correctly. Here’s a sample payload 

 

payload = {
'Note': {
'value': 'Vendor Order Items 255989'
},
'Details': [
{
'InventoryID': {
'value': 'GEN-10062'
},
'Note': {
'value': 'VO 226581, VOI 255989'
},
'TranType': {
'value': 'Issue'
},
'UnitPrice': {
'value': 0.1245
},
'UOM': {
'value': 'ML'
},
'WarehouseID': {
'value': 'TP-NY'
},
'Location': {
'value': 'TP-NY'
},
'Qty': {
'value': '1'
},
'ReasonCode': {
'value': 'TPISSUE'
},
'Allocations': [
{
'InventoryID': {
'value': 'GEN-10062'
},
'LotSerialNbr': {
'value': '54838052340'
},
'UOM': {
'value': 'ML'
},
'Qty': {
'value': '1'
},
'Location': {
'value': 'TP-NY'
}
}
]
}
],
'PostPeriod': {
'value': '10-2023'
},
'Date': {
'value': '2023-10-23'
}
}
Userlevel 1

worth to note that the base unit is in bottles, and im trying to push in ML. I see a UOM field so id think that i should be able to push an issue with whatever UOM i desire, is that not the case?

Userlevel 7
Badge +4

Hi @mikebar98,


Request payload looks good to me. I tried the following and able to set the UOM to the Detail Line and to its allocation,

{
"Description": {
"value": "From API"
},
"Details": [
{
"InventoryID": {
"value": "AAPOWERAID"
},
"UOM": {
"value": "PALLET"
},
"Allocations": [
{
"Location": {
"value": "R1S1"
},
"LotSerialNbr": {
"value": "LREX15026"
},
"Qty": {
"value": 20.000000
},
"UOM": {
"value": "EA"
}
}
]
}
]
}


Are you able to set the required UOM values from the UI?

Also, it would be worth checking the Units of Measure screen to setup the right conversion rate. 

Userlevel 1

here’s what i see after i PUT that payload i shared

 

 

Userlevel 1

 

Userlevel 1

it thinks i sent 1 bottle, when i sent 1 ML 

 

here is the conversion table

 

 

Userlevel 1

I can put whatever value i want in the allocation UOM, and the API will not yell at me. It feels that the system ignored the allocated UOM & goes with the base unit

Userlevel 7
Badge +4

Hi @mikebar98,

Yes, I see the behavior.

UOM is being bought from the Allocation Details, which defaults the Base unit from the Stock Item. 

 

 

I would suggest you check with the Product Support team, they should be able to suggest a configuration/setup that might allow you use different UOMs for a allocation. Thanks,

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved