on 02-17-2005 11:32 PM
Hi all,
Does anyone know how to create a service call activity? I've created a service call but now I need to create an activity for that service call. The DI help file states that you need to specify the ActivityCode, and then I assume you call the Add method.
But where or how do you obtain an ActivityCode? I've tried setting it to the newly created service call and also to a value of 1 but both of these attempts did not work.
Also the Add method does not return a value, so you can't determine whether or not the activity has been created unless you look at the service activiy table or the activity screen.
Does anyone else have any experience in this area?
Regards, Lita
If you create the activity first, this will give you an activity code which you can then use for the service call activity object.
Here is a sample adding a new activity to an existing service call.
Private Sub ServiceCallActivities()
Dim sboServiceCall As SAPbobsCOM.ServiceCalls
Dim sboContact As SAPbobsCOM.Contacts
Dim lngDocEntry As Long
'Create a new Activity
Set sboContact = sboCompany.GetBusinessObject(oContacts)
sboContact.CardCode = "SLU003"
sboContact.Closed = tNO
sboContact.ContactDate = Date
sboContact.Details = "Details...."
sboContact.Notes = "Sample notes..."
sboContact.DocType = oServiceCalls
sboContact.DocEntry = 31
sboContact.Add
'Get Activity Code
lngDocEntry = sboCompany.GetNewObjectKey
'Assign Activity to Service Call
Set sboServiceCall = sboCompany.GetBusinessObject(oServiceCalls)
sboServiceCall.GetByKey 31
sboServiceCall.Activities.Add
sboServiceCall.Activities.ActivityCode = lngDocEntry
sboServiceCall.Update
End Sub
John.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
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.