Skip to Content
0
Former Member
Mar 13, 2008 at 08:34 AM

URGENT: Service Call Activity Issue

308 Views

Hi guys, I have a seriously irritating issue concerning the linking of an activity to service call.

As of Service Pack 01, Patch 36 (at least as far as I know) I get the following error when attempting to create and link an activity to a service call:

Error Code: -5002

Error Description: A service call activity does not exist

I use the folliwing code;

If oServ.GetByKey(MRI) Then
                If DocType = "QT" Then
                    oAct = oComp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oContacts)
                    oAct.Activity = SAPbobsCOM.BoActivities.cn_Task
                    oAct.CardCode = oServ.CustomerCode
                    oAct.DocEntry = DocID
                    oAct.DocType = 23
                    oDoc = oComp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oQuotations)
                    If oDoc.GetByKey(DocID) Then
                        oAct.Notes = "Sales Quote: " & oDoc.Comments
                    End If
                    oAct.Details = "Sales Quote " & DocID & " auto created by MRI " & MRI & ""

                    If oAct.Add <> 0 Then
                        oApp.SetStatusBarMessage("Error adding Linked Document Activity for Sales Quote " & DocID & " : " & oComp.GetLastErrorDescription)
                        oLog.WriteLog("Error adding Linked Document Activity for Sales Quote " & DocID & " : " & oComp.GetLastErrorCode & oComp.GetLastErrorDescription, EventLogEntryType.Error)
                    Else
                        oServ.Activities.Add()
                        oServ.Activities.ActivityCode = oComp.GetNewObjectKey
                        oServ.Activities.SetCurrentLine(oServ.Activities.Count() - 1)
                    End If

 If oServ.Update <> 0 Then
                    oApp.SetStatusBarMessage("Error linking Expense Document " & DocID & ":" & oComp.GetLastErrorDescription)
                    oLog.WriteLog("Error linking Expense Document " & DocID & ":" & oComp.GetLastErrorCode & "-" & oComp.GetLastErrorDescription, EventLogEntryType.Error)
                End If

the Activity is added without any problem, but the error comes when linking it to the Service Call (oServ.Update)

Can you please help, I'm going insane with this problem.