API Forum

This forum is in read-only mode.
Please refer to our API support in case you have any questions.
We can be reached at api@e-conomic.com
e-conomic API developer forum

Cannot set department for product

0
I try to update a product:

Calling object method 'Product_UpdateFromData'
Array
(
    0 = Array
        (
            data = stdClass Object
                (
                    Handle = stdClass Object
                        (
                            Number = 4005
                        )

                    Number = 4005
                    ProductGroupHandle = stdClass Object
                        (
                            Number = 1
                        )

                    Name = Glove (white) to non-fancy dress
                    Description = Very nice dress
                    BarCode =
                    SalesPrice = 1025
                    CostPrice = 0000000
                    RecommendedPrice = 000
                    UnitHandle = stdClass Object
                        (
                            Number = 1
                        )

                    IsAccessible = 1
                    Volume = 5
                    InStock = 1
                    OnOrder = 1
                    Ordered = 1
                    Available = 1
                    DepartmentHandle = stdClass Object
                        (
                            Number = 2
                        )

                )

        )

)

Result
stdClass Object
(
    Number = 4005
)


And indeed department number 2 exists. No indication of an error. However, the product does not get the department assigned. If the product had a previously assigned department it is removed.

Now, you may think that there is a problem with the object for DepartmentHandle but it works fine with an order:

Calling object method 'OrderLine_UpdateFromData'
Array
(
    0 = Array
        (
            data = stdClass Object
                (
                    Handle = stdClass Object
                        (
                            Id = 48
                            Number = 1
                        )

                    Id = 48
                    Number = 1
                    OrderHandle = stdClass Object
                        (
                            Id = 48
                        )

                    DeliveryDate = 2012-06-22T071607+0200
                    Quantity = 1
                    UnitNetPrice = 1025
                    DiscountAsPercent = 000
                    UnitCostPrice = 000
                    TotalNetAmount = 1025
                    TotalMargin = 0
                    MarginAsPercent = 0
                    ProductHandle = stdClass Object
                        (
                            Number = 4005
                        )

                    Description = Glove (white) to non-fancy dress
                    DepartmentHandle = stdClass Object
                        (
                            Number = 2
                        )

                )

        )

)

Result
stdClass Object
(
    Id = 48
    Number = 1
)


I was wondering if there is a bug on the server side?

/Kjeld
created Jun 22, 2012 by ecodyr
0% Accept Rate
Q 6 A 10 C 1

Visma e-conomic A/S
...