7 Replies Latest reply: Jun 27, 2012 2:14 PM by Marc Roussel RSS

"Linked value 0 does not exist" when I duplicate OITM record by DI API

Joanne Lee
Currently Being Moderated

Hi,

 

I've got  error code -5002 and error meessage as below.

[OITM.Shght1Unit], "Linked 0 value 0 does not exist"  when I ran below code.

 

Source ItemCode does not have Height/length/Weight values.

 

I hope someone can help me.

 

Thanks

 

 

         

               sboItem.SaveXML(sFileName)

                 

                sboItem = oSBO.SboCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oItems)

                oSBO.SboCompany.XmlExportType = SAPbobsCOM.BoXmlExportTypes.xetExportImportMode

                sboNewItem = _oSBO.SboCompany.GetBusinessObjectFromXML(sFileName, 0)

 

                sboNewItem.ItemCode = sItemCode

                         

                iRet = sboNewItem.Add()

                If iRet <> 0 Then

                    '_oSBO.SboCompany.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_RollBack)

                    _oSBO.SboCompany.GetLastError(iRet, sErrMsg)

                    _oSBO.SboCompany.MessageBox(sErrMsg & vbCrLf & "Failed to duplicate item record")

                    Return ""

                Else

                    Return sboNewItem.ItemCode

                End If

Actions