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

Create SubScriptionLine from data

0

                Dim Subscriptlinedata As ISubscriptionLineData
                Dim Subscr As EconomicApiISubscription
                Dim SubscrNr As String
                Dim Product As EconomicApiIProduct
                Dim ProductNr As String
                Dim ChkInt As Integer
                Dim RowCount As Integer = DtContactRowsCount
                Dim i As Integer
                i = 0

                For Each Dr In DtContactRows
                    SubscrNr = Dritem(1)
                    Subscr = sessionSubscriptionFindByNumber(SubscrNr)
                    If Subscr Is Nothing Then
                    Else
                        Subscriptlinedata = sessionSubscriptionLineDataCreate(Subscr)
                        ProductNr = Dritem(2)
                        Product = sessionProductFindByNumber(ProductNr)
                        SubscriptlinedataProduct = Product
                        SubscriptlinedataProductName = DrItem(3) ' navn på faktura
                        SubscriptlinedataQuantity = CDec(DrItem(4))
                        If Dritem(5) =  Then
                        Else
                            SubscriptlinedataSpecialPrice = CDec(DrItem(5))
                        End If
                        If Dritem(6) =  Then
                        Else
                            SubscriptlinedataDepartment = DrItem(6)
                        End If
                        sessionSubscriptionLineCreateFromData(Subscriptlinedata)
                        DrItem(Transfered) = 1
                    End If
                    i = i + 1
                    ToolStripProgressBar1Value = 100 * i / RowCount
                    StatusStrip1Refresh()
                Next
                sessionDisconnect()

When using the above code i get a Subscriptionlinedata object which seems to be fine (number =0, department = nothing, specialprice=nothing, product is found, quantity is 1D), yet when i createfromdata it returns an error {An internal error has occurred. {id=939146622}}

Any help as to where i am going wrong, would be greatly appreciated.
created Jun 9, 2010 by Claus Aaberg
0% Accept Rate
Q 10 A 10 C 0

3 Answers

0
I finally figured it out. Department is not a nullable, which means that to create subscritionline via the api, there must exist at least one department.
answered Jun 10, 2010 by Claus Aaberg
0
Hi Claus,

That's quite obviously a bug - and a rather nasty one at that. We'll get a fix for it out over this coming weekend, and let you know here when it's in place.

Those involved in implementing and approving this without the proper test case(s) will be flogged appropriately...


Best regards,
answered Jun 10, 2010 by Christian Estrup
0
Hi,

This bug has now been resolved.

My apologies for the inconvenience.


Best regards,
answered Jun 13, 2010 by Christian Estrup

Network

Find all the documentation and resources you need to build great apps.
Go to Developer site

Newsletter

Get the latest news and important info from the e-conomic developer world.
Sign up now

Visma e-conomic A/S
...