Skip to main content
Solved

Upgrading SalesOrder API from 18.200.100 to 20.200.100


I have an api that pushes salesorders and it works if I set the version to 18.200.001.

When I move it to 20.200.001 it fails with the error

    [message] => An error has occurred.
    [exceptionMessage] => Sequence contains no matching element
    [exceptionType] => System.InvalidOperationException
    [stackTrace] =>    at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
   at PX.Api.ContractBased.EntityExportContextBuilder.ExtractFieldMappingKeyForDetail(String mappingKey, EntityField field, EntityMappingProjection[] entityFields, IMetadataProvider metadataProvider, IEntityMappingKeyService entityMappingKeyService, String endpointName, String version) in C:\build\code_repo\NetTools\PX.Api.ContractBased\EntityExportContextBuilder.cs:line 1343


The only information I can find about changes is on page 55  of  https://www.acumatica.com/media/2020/09/AcumaticaERP_IntegrationDevelopmentGuide.pd

Where it says

• The type of the Payments field is changed.

• Mapping has changed

 

After I get this working I do plan to get it to the latest version available ( "22.200.001")

Best answer by Django

I notice that you have on a couple of the lines:

            "LineType": {
                "value": ""
            },

Those should be one of the three line types available for SO Lines: Inventory, NonInventory, or MiscCharge. Or, remove this field from the json as Acumatica will set this field value for you.

You also don’t need to send values for these on your lines:

            "LineNbr": {
                "value": 1
            },
            "custom": {},
            "files": []

View original
Did this topic help you find an answer to your question?

3 replies

Forum|alt.badge.img+6
  • Captain II
  • 570 replies
  • April 1, 2025

Is it possible to see the json that you’re sending?


{
    "CustomerID": {
        "value": "EAST10"
    },
    "Date": {
        "value": "2025-04-01T21:47:15+00:00"
    },
    "Details": [
        {
            "InventoryID": {
                "value": "RM108VCF-O-M"
            },
            "LineDescription": {
                "value": " Rite Mate Cotton Drill Long Sleeve Closed Front Vented Shirt"
            },
            "LineType": {
                "value": "Inventory"
            },
            "MarkForPO": {
                "value": "true"
            },
            "OrderQty": {
                "value": "5"
            },
            "UnitPrice": {
                "value": "36.80"
            },
            "LineNbr": {
                "value": 1
            },
            "custom": {},
            "files": []
        },
        {
            "InventoryID": {
                "value": "NOTE"
            },
            "LineDescription": {
                "value": "SHIPPING ADDRESS,  EXAMPLECOMPANY - EXAMPLEADDRESS"
            },
            "LineType": {
                "value": ""
            },
            "MarkForPO": {
                "value": "false"
            },
            "OrderQty": {
                "value": ""
            },
            "UnitPrice": {
                "value": ""
            },
            "LineNbr": {
                "value": 2
            },
            "custom": {},
            "files": []
        },
        {
            "InventoryID": {
                "value": "NOTE"
            },
            "LineDescription": {
                "value": "Please deliver to  EXAMPLE Address\r\n\r\nThank you :) "
            },
            "LineType": {
                "value": ""
            },
            "MarkForPO": {
                "value": "false"
            },
            "OrderQty": {
                "value": ""
            },
            "UnitPrice": {
                "value": ""
            },
            "LineNbr": {
                "value": 3
            },
            "custom": {},
            "files": []
        }
    ],
    "Hold": {
        "value": false
    },
    "OrderType": {
        "value": "SO"
    },
    "CustomerOrder": {
        "value": "PO1232"
    },
    "Description": {
        "value": "name"
    }
}


Forum|alt.badge.img+6
  • Captain II
  • 570 replies
  • Answer
  • April 6, 2025

I notice that you have on a couple of the lines:

            "LineType": {
                "value": ""
            },

Those should be one of the three line types available for SO Lines: Inventory, NonInventory, or MiscCharge. Or, remove this field from the json as Acumatica will set this field value for you.

You also don’t need to send values for these on your lines:

            "LineNbr": {
                "value": 1
            },
            "custom": {},
            "files": []


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings