on 02-27-2009 9:06 AM
Hi to all,
Im doing a data intergration between 2 DB, DR (Source DB) and GRPO (Target) , I could inditify if the transaction were item or service, I dont have any problem if the the transaction is Item doctype , my problem were if im processing a service type , i encounter a error .
Error Message : Error Item no. is missing [PDN1.ItemCode][line:1]
Kindly see my source code for reference
For nLnDtls = 0 To nLnDtls - 1
oDR.Lines.SetCurrentLine(nLnDtls)
If oDR.DocType = BoDocumentTypes.dDocument_Items Then
oGRPO.Lines.ItemCode = oDR.Lines.ItemCode
oGRPO.Lines.ItemDescription = oDR.Lines.ItemDescription
oGRPO.Lines.WarehouseCode = oDR.CardCode
oGRPO.Lines.Quantity = oDR.Lines.Quantity
oGRPO.Lines.UnitPrice = oDR.Lines.UnitPrice
oGRPO.Lines.BatchNumbers.BatchNumber = oDR.Lines.BatchNumbers.BatchNumber
oGRPO.Lines.BatchNumbers.Quantity = oDR.Lines.BatchNumbers.Quantity
oGRPO.Lines.BaseLine = oDR.Lines.LineNum
oGRPO.Lines.Add()
Else
oGRPO.Lines.ItemCode = ""
oGRPO.Lines.ItemDescription = oDR.Lines.ItemDescription
oGRPO.Lines.AccountCode = oDR.Lines.AccountCode
oGRPO.Lines.LineTotal = oDR.Lines.LineTotal
oGRPO.Lines.BaseLine = oDR.Lines.LineNum
End If
Next nLnDtls
Dim oDocNum As String
If oGRPO.Add <> 0 Then
MsgBox("Error " + oCpTrgt.GetLastErrorDescription())
Else
oDocNum = oCpTrgt.GetNewObjectKey()
SndB1Msg(oDocNum, SAPbobsCOM.BoObjectTypes.oPurchaseDeliveryNotes, "New GRPPO")
Insert2OCTP(vDocNum, vDocDate, oDocNum, Now.ToShortDateString, vCardCode, vCardName)
End If
oRecordSetTrgt.MoveNext()
End While
Thank You
thanks to all
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Loren Flores,
The document has one default line and you need to call oGRPO.Lines.Add from second lines, so change code like:
For nLnDtls = 0 To nLnDtls - 1
If nLnDtls > 0 Then
oGRPO.Lines.Add()
End If
......
......
......
Next nLnDtls
Best Regards
Jane Jing
SAP Business One Forums team
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Just remove the line where you are setting the item code.
Rahul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
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.