Configuration Guide for Oracle CRM On Demand Financial Services Edition > Configuring Workflows for the Producer Success Model > Configuring Workflow Rules and Actions for the Producer Success Model >

Followup Calls for Referral or Review Calls Where the Result Is Stay in Touch and the Birthday Is Not in the Current Week and Is Within Six Months


This workflow rule is triggered when a producer calls a lead or client through a referral call or 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 does not occur during the current week but does occur within six months, the workflow rule creates a birthday call followup task to call the lead or client a week before the birthday.

NOTE:  The expressions in this topic might appear across several lines due to length. All expressions in this topic must be entered in Expression Builder as one line and cannot contain any spaces. Also, the language-independent field names and the field-name syntax used in the expressions in this topic are the field names and syntax that were used in Expression Builder in releases earlier than Release 29 Service Pack 1. These expressions are still valid in Release 29 Service Pack 1 and later releases. However, starting with Release 29 Service Pack 1, Expression Builder uses language-independent field names and a field-name syntax that are different from the field names and the field-name syntax used in earlier releases. So, if you select the corresponding fields from the field list in Expression Builder when you create or update an expression in Release 29 Service Pack 1 or a later release, then the field names in the expression will be different from the field names shown in this topic, and the fields will appear in the expression editor with the following syntax:

[{FieldName}]

It is recommended that you always select the fields for your expressions from the list of fields in Expression Builder, so that the field names and the field syntax are always correct. For more information about Expression Builder, see Oracle CRM On Demand Online Help.

Workflow Rule Details

This topic describes the details of the workflow rule.

Record Type

The record type in 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", "Referral Call") OR [<Type>]=LookupValue("TODO_TYPE", "Review Call")) AND [<PrimaryContactId>] = "No Match Row Id" AND [<CallResult>]=LookupValue("OD_CALL_RESULT", "Stay In Touch") AND PRE('<CallResult>') IS NULL AND JoinFieldValue('<Lead>',[<LeadId>],'<DateofBirth>') IS NOT NULL AND JulianDay(IIf(JulianDay(Mid(JoinFieldValue('<Lead>',[<LeadId>],'<DateofBirth>'),1,6)+ToChar(Today(),'YYYY')) < JulianDay(Today()),Mid(JoinFieldValue('<Lead>',[<LeadId>],'<DateofBirth>'),1,6)+ToChar(Today()+Duration("P1Y"),'YYYY'), Mid(JoinFieldValue('<Lead>',[<LeadId>],'<DateofBirth>'),1,6)+ToChar(Today(),'YYYY')))>JulianDay(Today()+7) AND JulianDay(IIf(JulianDay(Mid(JoinFieldValue('<Lead>',[<LeadId>],'<DateofBirth>'),1,6)+ToChar(Today(),'YYYY')) < JulianDay(Today()),Mid(JoinFieldValue('<Lead>',[<LeadId>],'<DateofBirth>'),1,6)+ToChar(Today()+Duration("P1Y"),'YYYY'), Mid(JoinFieldValue('<Lead>',[<LeadId>],'<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('<Lead>',[<LeadId>],'<DateofBirth>'),1,6)+IIf(JulianDay(Mid(JoinFieldValue('<Lead>',[<LeadId>],'<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('<Lead>',[<LeadId>],'<DateofBirth>'),1,6)+IIf(JulianDay(Mid(JoinFieldValue('<Lead>',[<LeadId>],'<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('<Lead>',[<LeadId>],'<DateofBirth>'),1,6)+IIf(JulianDay(Mid(JoinFieldValue('<Lead>',[<LeadId>],'<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.

CAUTION:  In the Subject field, three percent signs (%%%) are placed before and after the functions and field names. If you type a function or field name directly in the Subject field, you must type three percent signs before and after it. If you use Expression Builder to embed a function or field name, the percent signs are automatically added and must not be pasted into Expression Builder. When percent signs are pasted into Expression Builder, Expression Builder displays an internal error.

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('<Lead>',[<LeadId>],'<LeadFullName>')%%%

Configuration Guide for Oracle CRM On Demand Financial Services Edition, Release 37 Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Legal Notices.