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

product description not working

0
Hi e-co

please see attached pic, there is no product name even though we are setting it.
Is it something we are doing or a problem with api ?

Heres a snippet of where we set it:

If (objproduct Is Nothing) Then

                            Dim xmlProductName As XmlNode = Orderline.SelectSingleNode(DESCRIPTION)
                            Dim strProductName As String = xmlProductName.InnerText

                            Dim intProductGroupNumber As Int32 = 1
                            Dim objProductGroup As IProductGroup = session.ProductGroup.FindByNumber(intProductGroupNumber)
                            If (objProductGroup Is Nothing) Then
                                'create new
                            End If

                            objproduct = session.Product.Create(strProductNo, objProductGroup, strProductName)

                        End If


                        objorderline.Product = objproduct
                        objorderline.Product.Name = objproduct.Name
                        objorderline.Unit = objUnit

Any ideas ?

Thanks

Andy
created Apr 8, 2010 by andy
0% Accept Rate
Q 2 A 6 C 0

3 Answers

0
This:

objorderline.Product = objproduct
objorderline.Product.Name = objproduct.Name

- doesn't make sense - you're effectively setting Product.Name = Product.Name

What you seem to want is to set OrderLine.Description. You would TYPICALLY want to set this to Product.Name (that's what the web application will SUGGEST when creating order lines).


Best regards,

Christian Estrup
e-conomic
answered Apr 9, 2010 by Christian Estrup
0
Hi,

thanks for reply we also  tried to set description while create new product(master product)

and it still doesnt show up in the orderline, however the product's name and description have been loaded on the product, just not on the orderline.


            Dim objproduct As IProduct = session.Product.FindByNumber(strProductNo)

                        If (objproduct Is Nothing) Then

                            'OrderLine - Product - ProductName
                            'assumption : product description will there always
                            Dim xmlProductName As XmlNode = Orderline.SelectSingleNode(DESCRIPTION)
                            Dim strProductName As String = xmlProductName.InnerText


                            Dim intProductGroupNumber As Int32 = 1
                            Dim objProductGroup As IProductGroup = session.ProductGroup.FindByNumber(intProductGroupNumber)
                            If (objProductGroup Is Nothing) Then
                                'create new
                            End If

                            objproduct = session.Product.Create(strProductNo, objProductGroup, strProductName)
                            objproduct.Description = strProductName

                        End If

                        objorderline.Product = objproduct



See screenshot:
answered Apr 15, 2010 by andy
0
The only property on the order line you're setting is the Product. In the API, you must EXPLICITLY set the Description.

What you'll likely want to do is something like:

objOrderLine.Product = objProduct;
objOrderLine.Description = objProduct.Name;
-- Add Quantity (if non-1), price etc. as necessary


Best regards,

Christian Estrup
e-conomic
answered Apr 16, 2010 by Christian Estrup
Visma e-conomic A/S
...