on 08-01-2006 11:02 PM
Hi,
I've been generating production orders with my Add-On without any problems until I added the oProdOrders.Series line to my code and it doesn't matter if I hard code the Series value, it always gets me the same error:
-4200 NNM1 generating this document requires numbering to be determined for the document
Can anybody help me with this?
Here's a piece of my code:
oProdOrders.ProductionOrderOrigin = SAPbobsCOM.BoProductionOrderOriginEnum.bopooSalesOrder
oProdOrders.ProductionOrderOriginEntry = .UserDataSources.Item("DocEntry").Value
oProdOrders.CustomerCode = .UserDataSources.Item("CardCode").Value
oProdOrders.ItemNo = .UserDataSources.Item("ItemCode").Value
oProdOrders.Warehouse = .UserDataSources.Item("WhsCode").Value
oProdOrders.PostingDate = DateTime.Parse(Now, Nothing)
dtDueDate = Date.Parse(.UserDataSources.Item("DocDueDate").Value, Nothing)
If dtDueDate < Now Then
oProdOrders.DueDate = DateTime.Parse(Now, Nothing)
Else
oProdOrders.DueDate = .UserDataSources.Item("DocDueDate").Value
End If
'It was working fine before this line was added
oProdOrders.Series = CInt(Me.Formulario.Items.Item("cbxSeries").Specific.Selected.Description)
oProdOrders.PlannedQuantity = .UserDataSources.Item("Quantity").Value
'Loop for the PO lines
If oProdOrders.Add() <> 0 Then
Me.Company.GetLastError(intErrorAdd, sErrMsgAdd)
If (0 <> intErrorAdd) Then
sErrorMsg = sErrorMsg & "Production Order Error: " & CStr(intErrorAdd) & "," & sErrMsgAdd & _
". DocEntry: " & oProdOrders.ProductionOrderOriginEntry & vbCrLf
End If
End If
This is kind of an urgent matter so I'll greatly appreciate any help you can give me.
Thanks in advance...
Alfredo
Hi Alfredo,
What is in the series combo box? It should be the series number and not the description. Make sure you're passing the correct value.
Hope it helps,
Adele
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the responses.
Adele: The description in my combo is indeed the series number. The reason behind this: when I load value and description manually, the combo only displays the value unless the user clicks the combo (thinking in a normal scenario where the value should be the series number and the description should be the series name); so I just changed the way it was loaded so the user could see the series name.
I even tried hard coding the series number:
oProdOrders.Series = 5 '5 Is a series number that indeed exists in my DB
...But the error just keeps showing.
Also I have used this same series combo code in another Add-On that adds Credit Notes and Invoices, and this is the first time this error shows.
I'll keep looking to any anomalies in the code or the data retrieval anyway.
Thanks for the help. (Please keep it coming if you can )
Regards
Alfredo
User | Count |
---|---|
94 | |
11 | |
9 | |
5 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.