My Products
Help
SKAU AS
CONTRIBUTOR ***

subaccounts salesorder lines

by SKAU AS

Im trying to post a subaccount to the sales order lines without any luck.

The order is created in visma.net successfully, but the subaccount dosent change. 

The subaccount in the json is 0000-14-0000.

Any ide why its not changed on the lines ?

 

 

 

 

URL: https://integration.visma.net/API/controller/api/v1/

salesorderMethod: POST

Screenshot 2020-09-15 at 08.56.58.png

 

 "lines": [
        {
            "uom": {
                "value": "STK"
            },
            "note": {
                "value": null
            },
            "shipOn": {
                "value": "2020-09-15T06:38:55.348Z"
            },
            "lineNbr": {
                "value": 1
            },
            "freeItem": {
                "value": false
            },
            "poSource": {
                "value": null
            },
            "quantity": {
                "value": 1
            },
            "unitCost": {
                "value": 0
            },
            "completed": {
                "value": false
            },
            "markForPO": {
                "value": false
            },
            "operation": "Insert",
            "unitPrice": {
                "value": 20
            },
            "warehouse": {
                "value": "1"
            },
            "invoiceNbr": {
                "value": null
            },
            "reasonCode": {
                "value": null
            },
            "subaccount": [
                {
                    "segmentId": 1,
                    "segmentValue": "0000"
                },
                {
                    "segmentId": 2,
                    "segmentValue": "14"
                },
                {
                    "segmentId": 3,
                    "segmentValue": "0000"
                }
            ],
            "alternateID": {
                "value": null
            },
            "inventoryId": {
                "value": null
            },
            "projectTask": {
                "value": null
            },
            "requestedOn": {
                "value": "2020-09-15T06:38:55.349Z"
            },
            "salesPerson": {
                "value": null
            },
            "taxCategory": {
                "value": "3"
            },
            "branchNumber": {
                "value": "1"
            },
            "discountCode": {
                "value": null
            },
            "lotSerialNbr": {
                "value": null
            },
            "shipComplete": {
                "value": "BackOrderAllowed"
            },
            "discUnitPrice": {
                "value": null
            },
            "commissionable": {
                "value": false
            },
            "discountAmount": {
                "value": null
            },
            "expirationDate": {
                "value": null
            },
            "manualDiscount": {
                "value": false
            },
            "discountPercent": {
                "value": 0
            },
            "inventoryNumber": {
                "value": "300"
            },
            "lineDescription": {
                "value": "Vareprøve: (Parkett Skagen Eik Snow - 1731789)"
            },
            "overshipThreshold": {
                "value": 100
            },
            "undershipThreshold": {
                "value": 100
            },
            "salesOrderOperation": {
                "value": null
            }
        },

 

 

5 REPLIES 5

by Magnus Johnsen

Hi,

 

We have had a look at your JSON and tested it in our local company.

 

Firstly, salesOrderOperation should always have a value, either "Issue" or "Receipt".

 

Secondly, the issue with subaccount not being accepted seems to have to do with the salesPerson field:

With "salesPerson":   {"value": "null"} :

2020-09-15 09_56_04-Postman.png2020-09-15 09_56_27-Sales orders.png

 

Without the "salesPerson" field:

2020-09-15 09_57_17-Postman.png2020-09-15 09_57_44-Sales orders.png

 

We do not recommend sending any fields with null, if a field is not meant to be used in the operation, please omit it.

 

Please remove the field and try again.

 

Thank you. 

Yıldırım
VISMA

by Yıldırım (Updated ‎15-09-2020 10:15 by Yıldırım VISMA )

Hello, 

 

Sending

"salesPerson": {
 "value": "xxx"
 },

is causing the zeroization of the subaccount value.
This is the same behaviour as it's derived from the Financials UI. SubAccount will always be resetted to its default value when you select/include a Sales Person.

Workaround:
Exclude the "SalesPerson" field from your payload while POSTing a salesorder then if necessary, this can be added by the PUT request.

KonsultVn
CHAMPION ***

by KonsultVn

Hi, I have encountered the same issue. I have tried the workaround without success. I still get the same issue when sending a PUT request updating the salesperson field. This is the payload I am sending when this issue occurs:

 

{
"lines": [
{
"salesPerson": {
"value": "03"
},
"operation": "Update",
"lineNbr": {
"value": 3
},
}
],
"orderType": {
"value": "EK"
}
}

 

The update goes through and the sales person is set to 03 but the dimension values that originally is set to "3-090-03110" is updated to "0-090-00000"

Yıldırım
VISMA

by Yıldırım

Hello, have you tried updating/creating with the salesPerson first then sending PUT request for the subaccount ? 

Accepted solution
SKAU AS
CONTRIBUTOR ***

by SKAU AS

Thanx for clearing that up for me:) Now its working 100%.