My Products
Help
KonsultVn
CHAMPION ***

Error in the production environment when creating a sales order

by KonsultVn

For Monde Verde (company id: 2301700) we can not get past an error in the production environment when creating a sales order. The same setting works in their test company (2183985). We have compared the settings on SOs and Inventory and it seems to be the same. What is casting the error in the production company?

 

The error is: 

requestUri: controller/api/v2/salesorder / method: post / headers: Content: application/json

Authorization: Bearer 09f153ee-35e0-4eda-9b98-80803ce4ade5

ipp-application-type: Visma.net Financials

ipp-company-id: 2301700

 / response content: 

 {"message":"VismaId: 189900ef-1a30-4529-8f87-90f3cd89192c. Error creating salesOrder. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> 

 PX.Data.PXSetPropertyException: Inventory error: Item cannot be sold\r\n   at PX.Data.PXRestrictorAttribute.Verify(PXCache sender, PXFieldVerifyingEventArgs e, Boolean IsErrorValueRequired)\r\n... 

 

The request body is for prod is: (for the test environment we change to customer 49999 and any product number in the catalog)

{

    "OrderType": {

        "Value": "SO"

    },

    "CustomerRefNo": {

        "Value": "test"

    },

    "CustomerOrder": {

        "Value": "test"

    },

    "OrigOrderNbr": {

        "Value": "test"

    },

    "Hold": {

        "Value": false

    },

    "Description": {

        "Value": "Sofie test"

    },

    "Customer": {

        "Value": "40009"

    },

    "SoShippingAddress": {

        "Value": {

            "AddressLine1": {

                "Value": "Smedsbacksgatan 20"

            },

            "PostalCode": {

                "Value": "11539"

            },

            "City": {

                "Value": "Stockholm"

            },

            "Country": {

                "Value": "Sverige"

            }

        }

    },

    "SoBillingAddress": {

        "Value": {

            "AddressLine1": {

                "Value": "Smedsbacksgatan 20"

            },

            "PostalCode": {

                "Value": "11539"

            },

            "City": {

                "Value": "Stockholm"

            },

            "Country": {

                "Value": "Sverige"

            }

        }

    },

    "Lines": [

        {

            "Operation": "Insert",

            "InventoryNumber": {

                "Value": "111214"

            },

            "LineDescription": {

                "Value": "ALASTAR C M OPAL, pendlad"

            },

            "Quantity": {

                "Value": 1

            },

            "UnitPrice": {

                "Value": 1869.4872

            },

            "UnitCost": {

                "Value": 0

            },

            "DiscountAmount": {

                "Value": 0

            },

            "AlternateId": {},

            "MarkForPO": {

                "Value": true

            },

            "PoSource": {

                "Value": "DropShipToOrder"

            }

        },

        {

            "Operation": "Insert",

            "InventoryNumber": {

                "Value": "111821"

            },

            "LineDescription": {

                "Value": "L1:Opus 200 h\u00F6jd 131 mm gr\u00E5 IP44 rak 12W flickerfri LED 1300lm 3000K Ra\u003E90"

            },

            "Quantity": {

                "Value": 1

            },

            "UnitPrice": {

                "Value": 2131.8

            },

            "UnitCost": {

                "Value": 2131.8

            },

            "DiscountAmount": {

                "Value": 0

            },

            "AlternateId": {},

            "MarkForPO": {

                "Value": true

            },

            "PoSource": {

                "Value": "DropShipToOrder"

            }

        }

    ],

    "OrderNumber": {

        "Value": ""

    },

    "SoShippingContact": {

        "Value": {

            "overrideContact": {

                "Value": true

            },

            "name": {

                "Value": ""

            },

            "attention": {

                "Value": ""

            },

            "phone1": {

                "Value": ""

            }

        }

    }

}

3 REPLIES 3
KonsultVn
CHAMPION ***

by KonsultVn

Thanks! 

by Yıldırım

No problem ! Please let us know if we can be of any further assistance.

Accepted solution
Yıldırım
VISMA

by Yıldırım

Hello, 

"Inventory error: Item cannot be sold"

this seems to be related to the company configuration. The most efficient way to troubleshoot the error would be trying the same operation in the Financials ERP Company with the same data that has been sent via the API. 

 

In this way, the system can highlight the error (line / inventory) etc. in the Sales Order screen so that you can make the required adjustments accordingly. 

 

Thanks.