Followup Calls for Review Calls Where the Result Is Stay in Touch and the Birthday Is Not in the Current Week and Within Six Months
This workflow rule is triggered when a producer calls a lead or client through a review call and then updates the Call Result field in the Task edit page to Stay in Touch. If the birthday of the lead or client is not in the current week and is not more than six months from now, the workflow rule creates a review call followup task to call the lead or client a week before the birthday.
Workflow Rule Details
This topic describes the details of the workflow rule.
Record Type
The record type is an Activity record.
Trigger Event
The trigger event is When Modified Record Saved.
Rule Condition
The Workflow Rule Condition field contains the workflow rule condition.
Enter the following expression in the Workflow Rule Condition field:
[<Type>]=LookupValue("TODO_TYPE", "Review Call") AND [<CallResult>]=LookupValue("OD_CALL_RESULT",
"Stay In Touch") AND PRE('<CallResult>') IS NULL AND JoinFieldValue('<Contact>',
[<PrimaryContactId>],'<DateofBirth>') IS NOT NULL AND JulianDay(IIf(JulianDay(Mid(JoinFieldValue
('<Contact>',[<PrimaryContactId>],'<DateofBirth>'),1,6)+ToChar(Today(),'YYYY')) < JulianDay
(Today()),Mid(JoinFieldValue('<Contact>',[<PrimaryContactId>],'<DateofBirth>'),1,6)+ToChar(Today()
+Duration("P1Y"),'YYYY'), Mid(JoinFieldValue('<Contact>',[<PrimaryContactId>],'<DateofBirth>'),1,6)
+ToChar(Today(),'YYYY')))>JulianDay(Today()+7) AND JulianDay(IIf(JulianDay(Mid(JoinFieldValue
('<Contact>',[<PrimaryContactId>],'<DateofBirth>'),1,6)+ToChar(Today(),'YYYY')) < JulianDay
(Today()),Mid(JoinFieldValue('<Contact>',[<PrimaryContactId>],'<DateofBirth>'),1,6)+ToChar
(Today()+Duration("P1Y"),'YYYY'), Mid(JoinFieldValue('<Contact>',[<PrimaryContactId>],
'<DateofBirth>'),1,6)+ToChar(Today(),'YYYY')))<=JulianDay(Today()+Duration("P6M"))
Workflow Action Details
This topic describes the details of the workflow action.
Action Type
The action type is Create Task.
Task Type
The task type is a Birthday Call.
Due Date
The Due Date field contains a numeric value that is calculated by adding the value in this field to the date on which the task is created.
Enter the following expression in the Due Date field:
Today()+JulianDay(Mid(JoinFieldValue('<Contact>',[<PrimaryContactId>],'<DateofBirth>'),1,6)+IIf
(JulianDay(Mid(JoinFieldValue('<Contact>',[<PrimaryContactId>],'<DateofBirth>'),1,6)+ToChar
(Today(),'YYYY')) < JulianDay(Today()),ToChar(Today()+Duration("P1Y"),'YYYY'),ToChar(Today(),
'YYYY')))-JulianDay(Today())-(IIf(IfNull(Mid(1.0*(JulianDay(Mid(JoinFieldValue('<Contact>',
[<PrimaryContactId>],'<DateofBirth>'),1,6)+IIf(JulianDay(Mid(JoinFieldValue('<Contact>',
[<PrimaryContactId>],'<DateofBirth>'),1,6)+ToChar(Today(),'YYYY')) < JulianDay(Today()),
ToChar(Today()+Duration("P1Y"),'YYYY'),ToChar(Today(),'YYYY')))-7)/7,8,1),"0")>="7",(IIf
(IfNull(Mid(1.0*(JulianDay(Mid(JoinFieldValue('<Contact>',[<PrimaryContactId>],'<DateofBirth>'),
1,6)+IIf(JulianDay(Mid(JoinFieldValue('<Contact>',[<PrimaryContactId>],'<DateofBirth>'),1,6)
+ToChar(Today(),'YYYY')) < JulianDay(Today()),ToChar(Today()+Duration("P1Y"),'YYYY'),ToChar
(Today(),'YYYY')))-7)/7,8,1),"0")="7",5,6)),7))
Subject
The Subject field contains the subject line for the task. You can embed functions and field names in the text. Three percent signs (%%%) before and after an embedded function or field name indicate that it is to be converted to a string.
For more information about expressions, see Oracle CRM On Demand Online Help.
Enter the following expression in the Subject field:
%%%LookupValue("TODO_TYPE", "Birthday Call")%%%-%%%JoinFieldValue('<Contact>',[<PrimaryContactId>],
'<ContactFullName>')%%%