I am trying to default the new activity’s start time – based on the previously completed activity’s result.

Question:

Hi, we are trying to “make” users create follow up activities – to stay in touch with clients.
We are using 7.01 – which I think is important – because we are using the Global Activity script.

I have been successful in making the Activity form(s) automatically come up after a user completes an activity.
I did that by using this code from the Global Activity script:

Sub Application_AfterCreateHistory(Activity, Sender)
AutoPhoneCallActivity Activity, HistoryID
End Sub

sub AutoPhoneCallActivity(Activity, HistoryID)
Dim objActivity
Dim Index
Dim StartTime
Dim Results
Dim ActivityType

Results = activity.ResultString
ActivityType = activity.Type
If ActivityType = 0 or ActivityType = 1 or ActivityType = 2 or ActivityType = 5 then
If Results = “Left V-Message” or Results = “Continue Follow Up” then
Index = 1 ‘GetActivityIndexByName(Replace(Replace(Sender.Caption, “&”, “”), “…”, “”)) ‘DNL

If Index = 0 Or Index = 1 Or Index = 2 Then
Set objActivity = Application.Activities.Add(Index, Application.BasicFunctions.CurrentUserID)
objActivity.UserID = Application.BasicFunctions.CurrentUserID
objActivity.ContactID = activity.ContactID
objActivity.ContactName = activity.ContactName
objActivity.AccountID = activity.AccountID
objActivity.AccountName = activity.AccountName
objActivity.OpportunityID = activity.OpportunityID
objActivity.OpportunityName = activity.OpportunityName
objActivity.TicketID = activity.TicketID
objActivity.Category = activity.Category
objActivity.Title = activity.Title
StartTime = DefaultStartTime(activity)
objActivity.StartTime = StartTime
objActivity.Display
End If
End If
End If
end sub

I am trying to default the new activity’s start time – based on the previously completed activity’s result.
Does anyone know how I could do this?

 

Answer:

Try using this code:

Sub Application_AfterCreateHistory(Activity, Sender)
AutoPhoneCallActivity Activity, Activity.Key <– This gets the last History Id
End Sub

 

Submit a Comment

Your email address will not be published.

Subscribe To Our Newsletter

Join our mailing list to receive the latest Infor CRM (Saleslogix) and Creatio (bpm'online) news and product updates!

You have Successfully Subscribed!