tips and tricks for oracle crm on demand
DESCRIPTION
First of its kind work for CRM on demandTRANSCRIPT
-
Tips & Tricks for Oracle CRM On Demand
Volume 1 including exclusive tips
First book providing for free tips and tricks to improve your Oracle CRM On Demand application
Mathieu Emanuelli
Joann Alejandro Bravo
-
Times have changed. Companies are not anymore worried about its products, the production processes or
even the quality, today, what really determines a companys strategy is nothing more than people,
customers or prospects are modeling their market context following their needs and privileging what really
makes life easier. It seems that it is worthy then listening to people, what are their expectations, what
motivates them to come and ask try and buy new products
All these changes are not just coincidences, the world has really changed, human interactions are evolving faster than never before and the Internet as well as all the communication technologies being conceives every hour all around the world have finally put people and nothing else, in the top of the priorities and you know what? We, humans, just love it, this is actually all that we have ever wanted, to be listened and followed by our equals.
If you consider this new landscape, we are sure that we will not have to make big efforts in order to convince you that you as an individual but particularly, as a company, you need to listen people around in order to adapt and improve your offer for all your prospects and clients. The CRM (Customer Relationship Management) is just a grandiose combination between new technologies and a new world giving more and more importance to each individual opinion and broadcasting those opinions everywhere in just one second.
This book is intended to be a tool for all those companies using Oracle CRM On Demand and looking for better means to make the customer dreams become reality. If you have ever wanted to optimize your CRM configuration or integrate your CRM to the open internet world, this book is for you.
In the book, youll find three indicators for each How To:
Time to result : how much time the user need to apply successfully
Complexity: scale from 1 to 5
Gap with out of the box cap: What is the gap with Oracle CRM On Demand out of the box capabilities: 0% is a standard functionality, 100% is a complete custom development
WHY THIS PROJECT?
This project was born from our customer requirements. Yes, as many of you, listening to our customers gave us the key to this project. We start at the beginning, gathering up every single requirement demanding a high level of complexity in our projects implementation. In the earliest phases we intended those files to be exploited as a part of our internal knowledge data base.
A couple of implementations later and some years of experience shown us that some expected features requests came over and over again in our projects and most of the time, those request came from the Oracle CRM On Demand administrators looking for the way to make easier the use of the application or wanting to integrate the application to other tools available in the internet.
When the trend was confirmed, we decided to share our experiences with all the Oracle CRM On Demand community by writing this book that contains the functional and the technical points of view for every application improvement, we hope that you will find this information useful and that you will enjoy as much as we did, its implementation.
-
WHO ARE WE?
Author: Mr. Mathieu Emanuelli
Mr. Mathieu Emanuelli is currently CRM Practice Manager for a Swiss Consulting and Systems Integration (CSI) company. He has been working with Oracle CRM On Demand from the earliest phase of the product (has implemented release 12), in the first instance as user and administrator for his former company and lately as CRM consultant and product expert, managing implementation teams in international projects all around the world.
You can find more details about Mathieus work checking his profile in LinkedIn (type Mathieu Emanuelli)
Co-Autor: Mr. Joann Alejandro Bravo
Currently Mr. Joann Alejandro Bravo is a senior CRM consultant, specialized on SaaS (Software as a service) applications and Social CRM. In the past he has ensured the implementation as team member and team leader for multiple projects using Oracle CRM On Demand
You can find more details about Joann Alejandros work checking his profile in LinkedIn (type Joann Alejandro Bravo)
-
THANKS TO
Many thanks to our customers for all the new challenges during implementations, seeing Oracle CRM On Demand evolves in several business environments allow us to identify which information is worthy for most of the people using the application.
Of course, thanks to our company, Business & Decision, for being the central quarter for the Oracle CRM On Demand team. That was always a great opportunity to be involved in many challenging projects in different industries. Thanks to our colleagues and/or external people we had the chance to meet and/or to work with: Jonathan Fouque, Elios Gibanel, Sandrine Wens, Amine Hammi, Steffen Soldner, Josselain Prost, Laurent Petitguyot for their support, their imagination and their creativity.
Thanks to Oracles staff for being there and interact with us when particular questions concerning the application came up.
And last but not least, of course our beloved families, my wife and my children to have seen sawing daddy working hard after an official day work! Thanks as well to the fabulous Fab for being understanding during the work at home and all the support and encouragement.
-
TABLE OF CONTENT
GENERAL CONFIGURATION .................................................................................................................... 1
How to define parent and child relationship for any object? ...................................................................... 2
How to join activity & service request with context transfert? ................................................................... 8
How can I create a link to a document in the action bar or homepage? ................................................... 12
How to copy or set up a new record? ........................................................................................................ 14
How to concatenate with a workflow? ...................................................................................................... 17
How to calculate duration on a field using a default value or a workflow?............................................... 18
How to transform lower in upper case? ..................................................................................................... 19
How can i create a simple custom look-up? ............................................................................................... 21
How can i create a custom button that runs a custom look up from Edit and Detail page? ..................... 26
How can I create a custom look up that fill in many fields in Oracle CRM On Demand? .......................... 28
How to prevent the sales stage modification after the opportunity closed? ............................................ 39
How to monitor some variables evolution? ............................................................................................... 41
How can to create a custom button? ......................................................................................................... 43
How to avoid weekend selection for date type fields? .............................................................................. 47
How to make caps mandatory for field content? ...................................................................................... 56
How can I create an I-Frame in homepage?............................................................................................... 58
How can i create an i-frame with action bar content?............................................................................... 62
How can I rename the button Log A Call in activity related information? ............................................. 64
How can I create an information bubble on 1 or many fields? .............................................................. 67
How can I create a document including CRM merged fields and print it? ................................................. 74
How to see the primary account for a campaign recipient? ...................................................................... 81
-
SOCIAL NETWORKS AND CRM SOCIAL CRM ................................................................................... 83
How can i analyze my products in social network? .................................................................................... 84
How can i measure my contact profile influence in the social networks? ................................................. 86
How can i monitor social network content from OCOD? ........................................................................... 91
How to add Twitter feeds overview? ......................................................................................................... 97
How can i tweet automatically from OCOD? ........................................................................................... 100
How can i create a button with LinkedIn link in Oracle CRM On Demand? ............................................. 104
How to embed Yammer console into Oracle CRM On Demand? ............................................................. 106
How to make a mashup with Xing? .......................................................................................................... 112
How can I create a shoutbox for my users community? ......................................................................... 113
-
WEB INTEGRATION ................................................................................................................................ 119
How can I create a link between Oracle CRM On Demand and Skype? ................................................... 120
How can I use Skype applet for support? ................................................................................................. 122
How can I create satisfaction survey, send it to customer and measure feedback? ............................... 125
How can i create a link between Oracle CRM On Demand and Gmail? ................................................... 134
How can i send email with Gmail or Microsoft Outlook? ........................................................................ 136
How can i embed Google capabilities? .................................................................................................... 143
How can i embed Google talk into Oracle CRM On Demand? ................................................................. 146
How to create Web Applet with Google Maps? ....................................................................................... 148
How can I send SMS from the application (using email)? ........................................................................ 150
How can I send voice SMS from the application (using email)? .............................................................. 156
How can I send SMS from the application (using http request)? ............................................................. 161
EXCLUSIVE ! ............................................................................................................................................. 164
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
1
GENERAL CONFIGURATION
People want their life to be easier, and lets face it, we all want the same. When it comes to the adoption of a new application people are often asking: what is the added value that I am getting from it?
As every IT Consultant knows using out of the box applications is not always easy and, for sure, never totally adapted to the business needs. This is not because applications are not well developed but due to the fact that each company has its own way to complete processes and so its own customization needs. Consider all the information before and you can be sure about one thing, users want the applications to be as customized as possible in order to make little effort when using it, after all the only way for users to adapt a new tool is by getting more from it than they should give.
This chapter is dedicated to some of the more recurrent tricks used during the implementation for our clients, some of them concern first level data quality, some others take care about the form and the presentation and some others just integrate new features being added, in all cases as you will see, our efforts strives to ensure the adoption of the tool at every level of the company since, as you probably know, users are the success of technological evolution.
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
2
How to define parent and child relationship for any object?
INTRODUCTION Native relationships between different records of the same type are not available in OCOD, in fact only accounts (and from V19, opportunities as long as we know) propose the possibility to link internally their records. In companies everyday operations yet, users are looking for a way that easily allows defining connections and hierarchical relationships
BUSINESS CASES, WHEN ARTIFICIAL HIERARCHICAL RELATIONSHIP IS USEFUL Marketing programs, commercial action plans Think about a company trying to define a marketing program containing multiple campaigns aiming different markets (for example one market by country)
Figure 1: Parent campaign and child campaigns associated
And what about a company wanting to execute an action plan composed of a sequence actions what to do?
WHAT DO WE WANT TO DO? We would like to create a record related section providing a way to easily create a child record (related to the current record). Our example is based on activity objects but, of course, you can adapt this example.
Something like this:
Time to result
40 Mins
Complexity (1 to 5)
Level 3
Gap with out of the box cap
45%
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
3
Figure 2: Create a related record from custom related information
HOW CAN WE DO? We need to follow these steps in order to obtain our functionality:
Create a custom field called Related Activity ID which would store the parent Appointment Id
Create a web applet that embed the code for the related item
Create a Report which will show the related Tasks for this particular Contact Call
Embedded the report on the Call detail page
CREATE A CUSTOM FIELD TO STOCK THE RELATED ACTIVITY ID We have created a new field for the object Activity, called Related Activity ID and we have added it to the page layouts:
Figure 3: Create the Related custom field
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
4
Figure 4: Related custom field in page layout
Figure 5: Custom field displayed on the layout
CREATE THE WEB APPLET Next step, create a new web applet Related Tasks for both Appointments and Tasks and add it to the page layouts:
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
5
Figure 6: New web applet "Related Task"
The code is the following:
var Div_id = document.getElementById("customJavaScript").parentNode.id; var endIndex = Div_id.indexOf("Div"); if(endIndex>0) { var Title_id = Div_id.substring(0, endIndex) + "_Title"; var Title_obj = document.getElementById(Title_id); var newTD = document.createElement('td'); newTD.innerHTML = "New Related Task"; Title_obj.parentNode.insertBefore(newTD, Title_obj.nextSibling ); }
To understand: Yellow code: custom field ID (in this example we used an Indexed text field) Fields with the format %%%field%%% are tags coming from the application
This script should work for: Tasks:
Task Standard
Visit Report
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
6
Appointments:
Appointment Standard Visit
Once you add the web applet to the layout it appears like this:
Figure 7: Button created in the custom related information
Using this button you can create
Tasks related to an Appointment (when you are on Appointment Standard or Visit page layout)
Tasks related to a Task (when you are on Task Standard or Visit Report page layout)
When you click on this button the New Task creation page would be opened with the Related Activity ID field filled in automatically:
CREATE EMBEDDED REPORT Upon Save or Cancel, you will return to the Appointment or Task page layout and the Related Tasks web applet is automatically refreshed in a few seconds to reflect the change:
Figure 8: Report embedded showing the related record
But how is this contextual section alimented and updated? Start going to the reporting tool and building a report which looks like this:
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
7
Figure 9: column selected to create the report embedded
Notice that we have chosen the indexed short text field to store the related Activity ID so we need to ask for this information by adding the filter is prompted on this field Now, you can integrate the contextual report in the application using the following code
To understand: Yellow: column technical name for the custom field
Now you just need to add the web applet code to the script described previously, as follows:
Figure 10: Web applet with the whole code
Then, whole code is:
var Div_id = document.getElementById("customJavaScript").parentNode.id; var endIndex = Div_id.indexOf("Div"); if(endIndex>0) { var Title_id = Div_id.substring(0, endIndex) + "_Title"; var Title_obj = document.getElementById(Title_id); var newTD = document.createElement('td');
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
8
newTD.innerHTML = "New Related Task"; Title_obj.parentNode.insertBefore(newTD, Title_obj.nextSibling ); }
To understand: yellow: part of code to create the button associating the activities Blue: part of the code to enclosed the contextual report
How to join activity & service request with context transfert?
INTRODUCTION Using standard OCOD functionalities, it is impossible to create a Service Request from the detail page of an activity since service request is not a related section for the object activity. It gets even harder when in addition you need to copy some information (one or more values in different fields) coming from that activity in the new service request detail what can you do?
BUSINESS CASE Service Requests from tasks Imagine you or your client wants to create a service request from a task with the capability to keep the
contact filled in into the task layout that is what he ask us, we quickly understood that there were no
relation join task and service request since service request was not a tasks related information.
WHAT DO WE WANT TO DO? Simple to say: insert a button on the related information section of the object task to create a new service request (traitement) and pass the contact information from the task to the service request.
Time to result
40 Mins
Complexity (1 to 5)
Level 3
Gap with out of the box cap
30%
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
9
Figure 11: Expected result, a new related information including a button
HOW CAN WE DO? Follow the following steps to achieve the expected result:
FIND A SIMILAR PAGE AND COPY URL The first thing to do is to find a similar page to the one we want to generate when clicking the button that we will insert. We have decide to start from the contact page as, in the related information sections you can add a new service request (treatment) by clicking the button new
Figure 12: Button New for a service request
The following screenshot illustrates the page launched after the click:
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
10
Figure 13: Layout launched after the click
Now we need to copy the URL of this page. Be careful!!! do it from the edition page (instead of the consultation page) you should get something like:
https://secure-ausomxXXX.crmondemand.com/OnDemand/user/ServiceRequestNew?OMCR0=AIIA-O2B12&OMTGT=ServiceRequestEditForm&OMTHD=ServiceRequestNewNav&OMCBO=Contact&OMRET0=ContactDetail%3focTitle%3d%2b%26OMTGT%3dContactDetailForm%26OMTHD%3dContactDetailNav%26ocEdit%3dY%26OCTYPE%3dClient%26ocTitleField%3dFull%2bName%26ContactDetailForm.Id%3dAIIA-O2B12&OCNOEDITTYPE=Y&OCTYPE=
Modify the URL to meet the following format:
https://secure-ausomxXXX.crmondemand.com/OnDemand/user/ServiceRequestNew?OMCR0=%%%Contact_Id%%%&OMTGT=ServiceRequestEditForm&OMTHD=ServiceRequestNewNav&OMCBO=Contact&OMRET0=ContactDetail%3focTitle%3d%2b%26OMTGT%3dContactDetailForm%26OMTHD%3dContactDetailNav%26ocEdit%3dY%26OCTYPE%3dClient%26ocTitleField%3dFull%2bName%26ContactDetailForm.Id%3d%%%Contact_Id%%%&OCNOEDITTYPE=Y&OCTYPE=
To understand:
Blue: your POD
Yellow: The ID of the contact
Green : the variable for the Contact ID that will replace the ID contact (yellow)
CREATION OF A WEB APPLET The web applet which contains the button is created. As the button should be propose as a related section on the object task, the web applet has to be configured from the task configuration:
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
11
Figure 14: Web applet hosting the code to create custom related information with custom behavior button
The script for the button is composed of the URL on edition mode plus the button code.
Only two modifications to the script:
1. Copy the URL created previously as indicated (see URL highlighted in blue) and 2. Give a name to the button (name of the button highlighted in yellow here Nouvel Traitement:
var Div_id = document.getElementById("customJavaScript").parentNode.id; var endIndex = Div_id.indexOf("Div"); if(endIndex>0) { var Title_id = Div_id.substring(0, endIndex) + "_Title"; var Title_obj = document.getElementById(Title_id); var newTD = document.createElement('td'); newTD.innerHTML = "Nouveau traitement"; Title_obj.parentNode.insertBefore(newTD, Title_obj.nextSibling ); }
To understand: Blue: URL that we have created before
Yellow: display name of the custom button
Add this web applet to the layout and thats it, now, you can create service request whenever you want from the activities layout.
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
12
How can I create a link to a document in the action bar or homepage?
INTRODUCTION Users adoption depends, frequently, on how ergonomic the application is; people do not want to change
over and over again from a screen to another. Centralizing work tools is one of the greatest challenges on
a project.
BUSINESS CASES, ALL THE BUSINESS TOOLS IN THE SAME PLACE Knowledge data base or Dynamic catalogues Some companies use many tools to manage the Customer Relationship, although, they do not want to logout from the CRM to use it. When clients ask questions regarding products, the answers can be available in a knowledge data base and/or in a dynamic catalogue should users leave the CRM application to have access? Not anymore! Imagine that you want to propose the access to different applications, documents or any other web tool from any screen in the application what can you do?
WHAT DO WE WANT TO DO? We would like to have one or many links show in the action bar
Figure 15: Link created in the action bar
Or
Figure 16: Many links in the action bar
Time to result
10 Mins
Complexity (1 to 5)
Level 2
Gap with out of the box cap
90%
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
13
HOW CAN WE DO? Follow the following steps:
CREATE THE GLOBAL WEB APPLET
To create a link in html, we use tags and and put the content between. Content can be image. The tag can have 3 attributes:
href : indicates link address target : defines the links target
Figure 17: Global web applet created to embed a web applet in the action bar
The code in this example is the following:
Help me !
We could imagine a more complex code, defining a table including several links:
Figure 18: Global web applet created to embed a web applet (more complex) in the action bar
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
14
The code in this case would see like:
Help me ! Google LinkedIn Facebook
To understand:
Yellow: URL address
Blue: target
Red: Name of the link that will be displayed
ADD THE CUSTOM GLOBAL WEB APPLET TO AN ACTION BAR LAYOUT You can define a new action bar layout or you can add quickly this global web applet by clicking on My Set up link. Note: you could modify URL addresses using tags coming from Oracle CRM On Demand
How to copy or set up a new record?
INTRODUCTION Taking advantage from a pre existent record is a common practice that very often users which to apply. After all, why should I create from scratch my record if there is another containing almost the exact values that I need?
Time to result
40 Mins
Complexity (1 to 5)
Level 3
Gap with out of the box cap
70%
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
15
BUSINESS CASES Identical opportunities and several activities responding to the same problem This trick starts as a requirement from one of our clients who wished to be able to copy opportunities on his environment. Filling in the whole information in opportunities takes time because of the number of fields in this object so he wanted to take advantage from all this typing.
Once we found a technical solution, we realized that this code could of course be useful when copying records, but more than that, with some little variations, the code could work when initializing new records from a particular one. Lets see how?
WHAT DO WE WANT TO DO? We would like to copy or initialize a record keeping many pre-populated fields from the original one Since the release 17 users can copy a record but this functionality does not exist on every object. In addition, copy a record is a standard function not allowing any customization
HOW CAN WE DO? Create a web link that will contain all the information concerning the new record. You can either copy field by field the content or decide to copy only some fields and assign fixed values to others:
Figure 19: Web link created to copy a record
To define the content of the opportunity that will be created, you need to go to the opportunity edition page and copy its url, then edit this url in order to initialize as you want each field (this expression was built using the weblink editor):
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
16
Figure 20: Code to copy a record pasted in the web link definition
The code used is the following:
/OnDemand/user/OpptyCreateNewPageDefault?OMTGT=OpptyCreateEditForm&OMTHD=OpportunityNewNav&OMRET0=OpportunityHomePage&OpptyCreateEditForm.Primary Revenue Close Date=%%%Primary Revenue Close Date%%%&OpptyCreateEditForm.Description=%%%Description%%%&OpptyCreateEditForm.Account=%%%Account%%%&OpptyCreateEditForm.Account Id=%%%Account_Id%%%&OpptyCreateEditForm.ZDate_26=%%%dAward_Date%%%&OpptyCreateEditForm.ZPick_11=%%%plIntegration_Center_IC%%%&OpptyCreateEditForm.ZPick_10=%%%plSBL_Geographical_Zone%%%&OpptyCreateEditForm.ZPick_17=%%%plSegment%%%&OpptyCreateEditForm.ZPick_25=%%%plTHINT_Status%%%&OpptyCreateEditForm.ZPick_18=%%%plTHINT_Category%%%&OpptyCreateEditForm.ZPick_4=%%%plSBL_1%%%&OpptyCreateEditForm.ZDate_29=%%%dRFP_Date%%%&OpptyCreateEditForm.ZPick_13=%%%nP1_C%%%&OpptyCreateEditForm.ZPick_14=%%%plP2_%%%&OpptyCreateEditForm.ZPick_24=%%%plCountry_of_Origin%%%&OpptyCreateEditForm.ZPick_6=%%%plActivities%%%&OpptyCreateEditForm.Currency Code=%%%Currency_Code%%%&OpptyCreateEditForm.ZNum_21=%%%pcExpected_Gross_Margin%%%&OpptyCreateEditForm.ZPick_21=%%%plSubActivities%%%&OpptyCreateEditForm.ZPick_15=%%%plScenario%%%&OpptyCreateEditForm.ZPick_14=%%%nP1_C%%%&OpptyCreateEditForm.ZDate_30=%%%dProposal_Due_Date%%%&OpptyCreateEditForm.ZPick_9=%%%plCompetitiveNegociation%%%&OpptyCreateEditForm.OwnerAlias=%%%Owner_Alias%%%&OpptyCreateEditForm.ZPick_20=%%%plUnit%%%&OpptyCreateEditForm.ZPick_22=%%%plSubSegment%%%&OpptyCreateEditForm.ZCur_1=%%%cGlobal_Amount%%%&OpptyCreateEditForm.ZPick_12=%%%plLegal_Entity%%%&OpptyCreateEditForm.ZCur_3=%%%cThales_Amount%%%&OpptyCreateEditForm.ZPick_8=%%%plBusiness_Unit_BU%%%&OpptyCreateEditForm.ZPick_19=%%%plTHINT_Type%%%&OpptyCreateEditForm.ZMSPick_1=%%%msplBid_Currency%%%&OpptyCreateEditForm.ZPick_7=%%%plBid_Type%%%&OpptyCreateEditForm.ZPick_32=%%%plDepartment%%%&OpptyCreateEditForm.ZPick_30=%%%plTHINT_Client_Type%%%&OpptyCreateEditForm.ZPick_31=%%%plCivil__Military%%%&OpptyCreateEditForm.ZText_32=%%%stOpportunity_Group%%%&OpptyCreateEditForm.ZPick_35=%%%plInternalExternal%%%&OpptyCreateEditForm.ZCur_19=%%%cBid_Currency%%%&OpptyCreateEditForm.ZNum_20=%%%pcP3_%%%&OpptyCreateEditForm.Indexed Pick
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
17
1=%%%Indexed_Pick_1%%%&OpptyCreateEditForm.ZText_31=%%%stBid_Manager%%%&OpptyCreateEditForm.Sales Type=%%%
Now you can modify the values after the equal sign (=) in order to initialize your record with fix values if needed.
How to concatenate with a workflow?
INTRODUCTION Concatenated fields are very often useful when a particular naming rule is defined for an object, configuring your system this way avoid the need for you asking users to keep in mind the rule so they can focus on the business needs.
BUSINESS CASES Naming opportunities Imaging a company willing to name all its opportunities coming from leads following this rule:
Account name + Oppty ID
WHAT DO WE WANT TO DO? We want to populate the field opportunity name (or any other field) with the predefined content
HOW CAN WE DO? The general syntax to use when concatenating fields and including blanks between is:
[]+ ' ' + []+ ' ' + []+ ' ' + []
So you can now define a default value and a workflow to update the field, hereafter the concatenation for the field opportunity name
Time to result
10 Mins
Complexity (1 to 5)
Level 1
Gap with out of the box cap
100%
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
18
Figure 21: Example of a concatenate formula at a field definition level
Notice that, the workflow concatenation is only available for data in characters (exclude dates, timestamp or integer). If you want to concatenate with one of these type, use the function ToChar.
How to calculate duration on a field using a default value or a workflow?
INTRODUCTION Automatic calculation with dates used to be one of the better known limitations on OCOD. Values depending on time variables were just impossible to modify so very often system administrators had to use contextual reports like web applets to show the information. Fortunately, this is not a problem anymore.
BUSINESS CASES Warranties expiring on Imagine you need to fill in a date field when a particular action like a change on the opportunity sales stage is executed, or just think about the case of this example, a client trying to calculate the end date for a warranty how can you do?
WHAT DO WE WANT TO DO? My customer wanted the application to fill in automatically the ending date of warranty based on the purchasing date.
HOW CAN WE DO?
Time to result
15 Mins
Complexity (1 to 5)
Level 2
Gap with out of the box cap
100%
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
19
Using a post default value for the field we that we want to update (and adding a workflow if it changes on modification) with the following syntax:
[] + Duration('P2Y')
Figure 22: Example of syntax pasted in the field to calculate the end date of warranty
How to transform lower in upper case?
INTRODUCTION Data quality is a recurrent question when working with data bases. Sometimes is very important to keep a unique format for specific fields in order to ensure data identification or integration. This how to will show you how to automate and be sure that your data will follow the format that you define.
BUSINESS CASES, KEEPING YOUR DATA ON STANDARD FORMAT Often companies wish to use their customers data on marketing campaigns that are including information coming directly from the data base. Imagine for instance that you are generating a personalized e-mailing campaign, would you like to include names combining random upper and lowercase?
WHAT DO WE WANT TO DO? We would like to ensure that a particular field will be filled in with uppercase only. We do not want any workflow to run when saving the record, instead of that, we need the function to be active while typing the field value
Time to result
20 Mins
Complexity (1 to 5)
Level 1
Gap with out of the box cap
20%
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
20
Figure 23: Field in automatically in upper case
HOW CAN WE DO? We will create a global web applet embedded into the action bar:
Figure 24: Web Global applet to host the JavaScript
The code in this applet is:
function uppercaseInput() { var INPUT_ID = 'LeadCreateEditForm.Company Name'; var elem = document.getElementById(INPUT_ID); if( elem != null ) { elem.style.textTransform = 'uppercase'; try {
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
21
elem.addEventListener('keyup',function (e) { this.value=this.value.toUpperCase(); }, true); } catch(e){ elem.attachEvent('onkeyup', function (e) { this.value=this.value.toUpperCase(); }); } } } setTimeout ( "uppercaseInput()", 2000 );
To understand: Yellow: Field ID where we would like functionality activated
SOME APPLICATION EXAMPLES
Using a field as a part of the primary key of a record in interfaces
Imagine that you are interfacing 2 different systems, updating some particular information for the same set of records based on a key. Imagine as well that one (or several) field making part of the primary key is systematically filled in with caps for one of the systems how can you ensure the primary key correspondence? We are guessing that after this reading you have a particular idea in mind dont you?
How can i create a simple custom look-up?
INTRODUCTION Oracle CRM On Demand allows users to define relationships between tables (known as objects). These relationships are defined in many ways including related information (for 1 to many relationship) or the lookup for 1 to 1 relationship. Some standard functions provide users with the capability to join two object non-related in a conventional way by using JoinfieldValue. Sometimes this function is not enough since it works only between a well defined group of objects. Do not worry if you want to go further, we have found an alternative solution for these particular requirements: just use reports capabilities and build a custom lookup are you wondering how? Keep reading
BUSINESS CASES, WHEN SIMPLE CUSTOM LOOK UP IS USEFUL Many Oracle CRM On Demand users would like to fill in fields with a value coming from a non-linked object simulating thus, a standard lookup (that appears with the following icon: )
Time to result
15 Mins
Complexity (1 to 5)
Level 2
Gap with out of the box cap
100%
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
22
The most frequent example concerning this functionality is the creation of a hierarchical relationship inside a particular object. Lets consider for instance a marketing program, launched in Europe and composed of many campaigns linked to the marketing program. In this case the simplest way to create this non-standard relationship is the custom look up.
WHAT DO WE WANT TO DO? It is possible to simulate a look up behavior by creating a custom look up based on reports. This how to will show you how you can create a simple custom look up catching one field content coming from the report. (Notice that you will find the equivalent functionality for more than one field later on this book) So lets create a report containing the required information. Please notice that this report will include a link sending the information to the right field:
Figure 25: Simple custom look catching one field content
HOW CAN WE DO?
FIND OUT THE FIELD ID OF THE TARGET FIELD (FIELD TO FILL IN)
We need to know the Oracle CRM application field id that we will fill in by clicking on the report.
1. On Firefox, select the field you would like to fill in 2. Right Click 3. Select view selection code
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
23
Figure 26: View selection code
4. Find and keep in your notepad the field ID Note: To find out the field ID with IE you need to right click, select view source and search thanks to the field display name.
CONFIGURE THE REPORT COLUMNS
Our example is based on a report related to the products table. The value that we would like to fill in is the product name. To create a report with a custom look up behavior:
1. Create the report including the column that you would like to display 2. Add the column containing the value that you would like to send into the target field 3. Set up this column as follows:
a. Select Column properties
Figure 27: Click on Column Properties
b. Select Data format tab and insert the following code:
"http://"@[html]"Select"
To understand: Yellow: name of the link that will appear in the place of the value
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
24
Figure 28: Insert the code in Data Format Tab
4. After the execution of the previous steps your report will contain two columns as shown:
Figure 29: Report built overview
CREATE THE REPORT NARRATIVE VIEW
We have to create a narrative view using with the following code:
function Callback(Line) { var Line = Line var theform = window.top.opener.document.getElementById("ServiceRequestEditForm"); for (n=0;n
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
25
To understand:
Yellow: page name Blue: Field id (catch in previous step)
Note: usually the field ID is based on the following pattern: page_name.Field_name
CREATE A WEB LINK
We need now to create the custom function into a report to catch the expected value that will feed our
CRM target field. To do this we just need to create a web link with the report path to run it from the target
record detail page in the CRM application:
Figure 30: Create a web link with the report path
Note: To run a custom report we are going to need to click the Edit button in the target record detail
page. If you want to run the custom lookup without editing the page, please read the HowTo How to run
a custom lookup without clicking on page Edit Button on a single object
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
26
How can i create a custom button that runs a custom look up from Edit and Detail page?
INTRODUCTION Custom look ups are quite useful and I think we all agree about it, although, when using it, many of us have asked why we cannot use it from the simple view page with not need to previously click the edit button surprisingly, is possible keep reading if you want to find out
WHAT DO WE WANT TO DO? We would like to create a custom button that runs a custom look up in edit and detail page:
Figure 31: Button created to run the custom look up
CODE TO INSERT This code has been created to launch a custom report service request in order to call a report related on product. That aims to catch a product into a Service Request through a custom lookup. The code is the following:
// First step: Open report and switch page in edit Mode function openLink(target) { // Open the reportrelated on custom lookup var str = "https://secure-ausomxXXX.crmondemand.com/OnDemand/user/analytics/saw.dll?Go&Path=%2fshared%2fCompany_30701_Shared_Folder%2fProduct+Workaround&Options=rfd&Action=Prompt"; var editButton = "Edit"; var tdtd = document.getElementsByTagName("td"); for (var i = 0; i < tdtd.length; i++) {
Time to result
50 Mins
Complexity (1 to 5)
Level 3.5
Gap with out of the box cap
20%
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
27
// Simul clic sur Bouton Edit if (tdtd[i].innerHTML == editButton){ if(target =="Service" ) doNamedInvoke('ServiceRequestEditNav', tdtd[i]); break ; } } window.open(str); } // End Function // Second step: Parse page et define location for the button function addCustomPickListButton() { var currentPage = document.getElementById('ocTitleFieldLabel'); var sr ="Consumer"; var target =""; if(currentPage != null && currentPage.innerHTML != null && (currentPage.innerHTML.match("^"+sr)==sr ) ) { target ="Service"; var tdtd = document.getElementsByTagName("td"); for (var i = 0; i < tdtd.length; i++) { // this button will be displyed close to text "Select product" if (tdtd[i].innerHTML == "Select product" || tdtd[i].innerHTML == 'Select product' ){ tdtd[i+1].innerHTML=" "; } } } } setTimeout ( "addCustomPickListButton()", 1000 ); // To be sure the Action Bar is loaded
To understand: Yellow: repot path. Be aware to change the POD Blue: target page name in edit mode Green: text closed to the button will be displayed
Objectives of this code are to:
1. Create a button and put in the layout in Edit and Detail pages for lead and deal Objects 2. Switch the page in Edit mode if the page is not to allow the custom lookup to run 3. Open the report that embed the code for sending values into the layout
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
28
** Some comments have been added to let you understand code lines.
EMBED THIS CODE IN OCOD The code has to be defined into a Global web applet, displayed in the action bar:
Figure 32: Global Web applet displayed in the action bar
Note: Do not forget to add this global web applet in the action bar and to create the custom look up.
How can I create a custom look up that fill in many fields in Oracle CRM On Demand?
INTRODUCTION Lets say that this How to is the second of my favorites (I let you find the first one in the book) I am sure that you know the standard custom lookup, I mean the one that send one value from a report into the application. Then, here is the evolved version of it ! This custom look up will be able to fill in several values in one shot, from a report to the application.
BUSINESS CASES, KEEPING KEY IDENTIFICATION Imagine that you want to recover data concerning an order in the application; you want the ID in order to keep a primary key relationship but also, the order number coming from an external application. Obviously you want to do it with the minimum number of clicks
Time to result
30 Mins
Complexity (1 to 5)
Level 3,5
Gap with out of the box cap
40%
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
29
WHAT DO WE WANT TO DO? We would like to create a custom report that could fill in 2 fields in the application: OCOD with the link to the custom look up:
Figure 33: Link to the custom lookup
HOW CAN WE DO? Let us follow the following steps:
IN ORACLE CRM
CREATE CUSTOM FIELDS
Fields that will receive information should be text fields and should not be defined as Read only:
Figure 34: Fields that have been filled in
FIND THE SYSTEM NAME OF THE CUSTOM FIELDS
We need then to find the system name of the custom fields we have created previously:
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
30
Figure 35: Right click and select view Source
When the source page is displayed, do a search (Ctrl + F) based on the field display name. The system name follows the format: Page_name.field_name
Figure 36: Edit page source and search the system name thanks to fields display name
Keep these system names by copying in your favorite text editor:
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
31
Figure 37: Copy system name
Now that we have the containers waiting for the data, we need to create our report:
IN ORACLE ANSWER (REPORT) We need now to create a report that will feed our custom fields:
CREATE YOUR REPORT (STEP 1)
Select expected columns to build your report:
Figure 38: Columns selected to create our report
As we want to prompt orders (opportunities) owned by the contact we are based on, we will add a filter based on the contact ID:
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
32
Figure 39: filter to display only opportunities owned by the displayed contact
CREATE THE LINK TO FEED THE APPLICATION FROM THE REPORT
We will create a column that will display a link with the name Slectionner une commande (select an
order.
Use a custom format for the column
We will use a custom format for all data displayed on this column based on JavaScript function (Callback):
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
33
Figure 40: Custom format used
The code is the following:
"http://"@[html]"Slectionner
une commande"
To understand:
Yellow: is the link name
Define fx in the column In the fx defined in our column we must find all the parameters that will be used in the future:
In our example, we need to find two fields:
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
34
Figure 41: Fx definition
The formula used is:
CONCAT(Opportunity."Opportunity ID", CONCAT('?', Opportunity.Name))
To understand: Yellow: two fields we are interested in to fill in our application Blue (?): the sign ? allow us to separate both fields. Before selecting this key, be sure that it will not be used in any other column
Note: we can also use the sign || to define a concatenation function as follows:
"- Product Category"."Parent Product" || '?' || "- Product Category"."Category Description"
Add a narrative view Now we have to host the JavaScript that will parse our report and run the callback function to fill in our two application field:
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
35
Figure 42: Add a narrative view
Figure 43: Code to paste in the narrative view
Paste the code:
function Callback(Line) { var Line = Line; // Le parameter Line permet de rcuprer les valeurs contenu dans la colonne Slectionner dfinies plus haut ( soit (CONCAT(Opportunity."Opportunity ID", CONCAT('?', Opportunity.Name)))
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
36
var position = Line.indexOf('?'); // Index Of est une fonction Javascript permettant de renvoyer la position du parameter (?) dans la chaine Line. La variable position permet de dfinir la poistion du ? var MyCommandeID = Line.substring(0, position); // Commande ID est compris entre 0 et la variable position (?) var MyCommandeName = Line.substring(position+1); // Commande name est situ la position ? +1 // Get SR form from parent page var theform = window.top.opener.document.getElementById("ServiceRequestEditForm"); for (n=0;n
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
37
} if (theform.elements[n].id == "DealRegistration.EditForm.ZText_2") { theform.elements[n].innerText= MyProgramName ; theform.elements[n].value = MyProgramName ; } } window.close(); }
CREATE THE LINK BETWEEN ORACLE CRM ON DEMAND AND ORACLE ANSWER Now we have to create a web link that will run the prompted report:
RETRIEVE THE REPORT PATH
To find the report path, run it in internet Explorer, right click on it and select properties:
Figure 44: Copy the report path
CREATE A WEB LINK FIELD
Get back to oracle CRM On Demand and create a web link that will run the prompted report
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
38
Figure 45: Create the custom web link
Figure 46: Detail on the formula used
Note: You have to specify Open in a new window In our example, the URL is the following:
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
39
https://secure-
ausomxXXX.crmondemand.com/OnDemand/user/OpportunityDetail?ocTitle=%%%Indexed_Short_Text_0
%%%&OMTGT=OpptyDetailForm&OMTHD=OpportunityDetailNav&ocEdit=Y&OpptyDetailForm.Id=%%%stI
D_Commande%%%&OCTYPE=Nouvelle+activit%C3%A9&ocTitleField=Name
How to prevent the sales stage modification after the opportunity closed?
INTRODUCTION Consolidating figures could be a tricky question with CRM. Sometimes users just are not that sure about the information that they are entering in CRM. You might want to ask accurate updates on the database so you can take information as real facts, thus, it would be worthy for you to prevent users from changing the Opportunity Sales Stage picklist value from Closed/Lost or Closed/Won back to any of the earlier stages (say, Short List, Negotiation, etc.)
BUSINESS CASES, WHEN CLOSED OPPORTUNITY MODIFICATION RESTRICTION IS USEFUL Matching financial and commercial information Imagine that you need to validate your financial figures with commercial information coming from your sales force. We are guessing you do not want to find any inconsistency that push you make many calls and ask to a half of your sales why information does not match what to do? What about Forcing your users to announce the final decision at the real end of the opportunity and not being able to get back if they do not?
WHAT DO WE WANT TO DO? We want to block opportunities with status Closed. Does not matter if they are Won or Lost.
HOW CAN WE DO? This can be achieved by writing a field validation rule for the Sales Stage Id field in the Opportunity record-type. Usually field validation rules are written directly for the field that one wants to control, but in this case, you cannot write these rule for the Sales Stage field, since the field validation option is disabled. Instead of this, you can use the Sales Stage Id field to achieve the same result 1. Locate Sales Stage Id on the Opportunity Field Setup page and click the Edit link.
2. Enter the following rule in the Field Validation field:
PRE('')'Closed/Won' AND PRE('')'Closed/Lost'
Time to result
40 Mins
Complexity (1 to 5)
Level 1,5
Gap with out of the box cap
100%
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
40
If you want only users with a certain role, such as the Administrator, to have the ability to change a
closed opportunity to one of the earlier stages, then you can exclude that user role in the field
validation rule:
(PRE('')'Closed/Won' AND PRE('')'Closed/Lost') OR (UserValue('')='Administrator')
3. Enter the error message that should be displayed when a user tries to change the sales stage value on
a closed Opportunity record.
4. Click Save.
5. Test the field validation rule to make sure it works as you expect.
Figure 47: Validation message after applying workflow to restrict opportunity status changes
If you want to see more details, including more pictures, check out this document on My Oracle Support: Restricting Opportunity Sales Stage Value Using Field Validation (Doc ID 841398.1: You'll need to sign in with your My Oracle Support account to access the document.)
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
41
How to monitor some variables evolution?
INTRODUCTION Sometimes, is worthy for users to follow up the evolution of certain variables that will, in consequence, facilitate and encourage the team work by allowing managers to help at the right moment their team members.
BUSINESS CASES, WHEN MONITORING VARIABLES IS USEFUL Following up opportunities evolution Imagine for instance, a sales rep. who has created an opportunity for the current year but it is been a while since he modified it for the last time. As a manager, you would like to see how could you help him to concretize his opportunity and win it but how could you know who needs support at the right moment? Well in this document we will build a report concerning opportunities (you can do the same with any object) that will let you know when a particular field was modified for the last time and what was its previous value. Contact form
As you can imagine from now, many uses are possible with this functionality, lets go deeper and see some other examples.
WHAT DO WE WANT TO DO? We want to follow up the changes realized on a group of fields and the dates of these changes. Then, we would like to follow up those fields in a report showing evolution and identifying need for action.
HOW CAN WE DO? We are going to need some pivots fields to stock evolution information, then a report concerning those fields will alert us about actions required.
STEP 1: PIVOT FIELDS
Time to result
30 Mins
Complexity (1 to 5)
Level 2,5
Gap with out of the box cap
100%
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
42
Create pivot fields for the object that contains the date and the previous value for the fields that you want to follow up. In our example this object is the opportunity and we will follow up the field Sales Stage. We need to create two pivot fields for each monitored field. The first one keeping the field previous value and the second one will indicate the last modification date not for the record but for the field being monitored.
Figure 48: Example of pivot field used to monitor some variables evolution
STEP 2: WORKFLOWS Once the fields are available we will need to populate it automatically with the right information. To do this, lets create a workflow for the field taking the information as shown on the figure below:
Figure 49: Workflow defined to monitor some variables evolution
The condition triggering the workflow is the field (and no the record) modification. The function PRE allows you to compare the previous value to the new one. Concerning the workflow activities, set the field values as follows:
Figure 50: Workflow definition to monitor some variables evolution
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
43
Figure 51: Date to monitor some variables evolution
STEP 3: CREATE AND BUILD YOUR REPORT Now that your records are correctly populated, create your report and make it available for all managers wanting to monitor opportunities sales stage evolution.
Figure: Example of report created to monitor some variables evolution
Note:
- Please notice that this reports needs at least two days to be finalized since new customized fields are available on analytics just the day after its creation.
- If you need to go farther on modification history, you can use the same philosophy to explore previous modifications, but you will have to create two additional fields each time.
How can to create a custom button?
INTRODUCTION Integrating custom buttons following specific behavior is very often worthy to respond to particular requirements which are not standard functionalities in OCOD. Using code you can get to create many interesting possibilities. Lets see how can we integrate buttons.
BUSINESS CASES, WHEN CUSTOM BUTTONS ARE USEFUL Creating a custom look up filling up multiple fields
Time to result
30 Mins
Complexity (1 to 5)
Level 3
Gap with out of the box cap
30%
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
44
Standard look up functionality can only fill in one field at a time what about saving time and effort for your users when creating and/or editing records?
WHAT DO WE WANT TO DO? We would like to create a custom button with a custom behavior. This how to is based on an example realize on "lead" object:
Figure 52: Example of custom buttons created
HOW CAN WE DO?
CREATE THE JAVASCRIPT
We need to create a code, as follows:
type="text/javascript" id="customJavaScript"> // comportement du bouton function linkedIn(addr){ window.open (addr); //pour un popup. Pour ouvrir dans la page courante: window.location } function addCustomPickListButton2() { var tdtd = document.getElementsByTagName("td"); // initialisation des variables var fname =""; var lname =""; // premiere partie: affecte valeur dans les pages de detail //pour acceder a une valeur de champ en edit mode la fonction est .innerHTML
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
45
for (var i = 0; i < tdtd.length; i++) { //parcours la page if (tdtd[i].innerHTML == "First Name"){ fname = tdtd[i+1].innerHTML; } if (tdtd[i].innerHTML == "Last Name"){ lname = tdtd[i+1].innerHTML; } } // deuxieme partie: affecte valeur dans les pages edit // va chercher l'element egal a td+1 (valeur du champs) //pour acceder a une valeur de champ en edit mode la fonction est .value if(fname == "" && document.getElementById('LeadCreateEditForm.First Name') != null ) fname = document.getElementById('LeadCreateEditForm.First Name').value; if(lname == "" && document.getElementById('LeadCreateEditForm.Last Name') != null ) lname = document.getElementById('LeadCreateEditForm.Last Name').value; //Troisieme partie: creer le bouton et reference a son comportement for (var i = 0; i < tdtd.length; i++) { // parcours la page // On place le bouton a cote du texte "Linked In" if (tdtd[i].innerHTML == "Linked In" || tdtd[i].innerHTML == '="fl">Linked In' ){ // page de detail ou page edit // reference au comportement du bouton tdtd[i+1].innerHTML=""; } } } setTimeout ( "addCustomPickListButton2()", 1000 ); // To be sure the Action Bar is loaded
CODE EXPLANATION
We put some comments into the code, but let us explain how you can adapt this code:
CREATE THE LINK FOR THE BUTTON TO FOLLOW
We have to write the link in a variable because Javascript cannot follow a simple URL:
function linkedIn(addr){ window.open (addr); //pour un popup. Pour ouvrir dans la page courante: window.location } function addCustomPickListButton2() {
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
46
LOOKING FOR "TD" ELEMENTS
Specify that you are looking for td elements
var tdtd = document.getElementsByTagName("td");
VARIABLE DECLARATION
Specify the variable(s) that will compose our URL (the example is based on tags that will compose the URL):
var fname =""; var lname ="";
PARSE THE CURRENT PAGE
This will parse every page where the application is
for (var i = 0; i < tdtd.length; i++) {
SEARCH ELEMENTS IN EDIT PAGES
To find elements that we are looking for in an edit page, the function is ".innerHTML" To find the element (the value in the fields called "Last Name" and "first Name"), we are looking for the elements after elements called "Last Name" and "first Name", some element after td = Last name and First name, so td+1:
if (tdtd[i].innerHTML == "First Name"){ fname = tdtd[i+1].innerHTML; } if (tdtd[i].innerHTML == "Last Name"){ lname = tdtd[i+1].innerHTML; } }
SEARCH ELEMENTS IN DETAILS PAGES
To find elements that we are looking for in an edit page, the function is ".value" To find the element (the value in the fields called "Last Name" and "first Name"), we are looking for the elements after elements called "Last Name" and "first Name", some element after td = Last name and First name, so td+1
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
47
if(fname == "" && document.getElementById('LeadCreateEditForm.First Name') != null ) fname = document.getElementById('LeadCreateEditForm.First Name').value; if(lname == "" && document.getElementById('LeadCreateEditForm.Last Name') != null ) lname = document.getElementById('LeadCreateEditForm.Last Name').value;
Of course, you have to adapt the page name depending object where you want to put the custom button
SELECT THE PLACE WHERE WE WOULD LIKE TO PUT THE CUSTOM BUTTOM
We will parse de page and find the display name "Linked In" in the current page to place the button right after. Once again in the edit page specify ".innerHTML" and in detail page ".value"
if (tdtd[i].innerHTML == "Linked In" || tdtd[i].innerHTML == 'Linked In' ){
SPECIFY BEHAVIOR ON THE BUTTON
if (tdtd[i].innerHTML == "Linked In" || tdtd[i].innerHTML == 'Linked In' ){
PUT THE CODE IN A CUSTOM WEB APPLET
The code, once adapted to your environment, has to be copied in a custom web applet
Figure: Global Web applet created to create a custom button
And don't forget to add this web applet to the action bar for users...
How to avoid weekend selection for date type fields?
Time to result
50 Mins
Complexity (1 to 5)
Level 4
Gap with out of the box cap
20%
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
48
INTRODUCTION Business rules and daily work restrictions can add complexity to the configuration of a CRM. Imaging that you are using your application to monitor your deliveries and, as many of us, some of the members of your supply chain do not work on weekends. You do not want to plan shipping and deliveries in those dates since performance indicators will not correspond to reality what to do without checking carefully the calendar each time that you create and/or edit a record?
BUSINESS CASES, WHEN AVOIDING WEEKENDS IS USEFUL Avoiding weekend choice Imagine that your customer wants an automatic calculation to be launched on a date field type in order to avoid week end and this, for the Service Request object which includes a dynamic layout (rule should be triggered just for a particular service request type) The dates in question represent the final shipment date and the pickup start date (commitment from the shipping provider) which are, as well, calculated depending on a department selection and a original pickup and shipment date selection.
WHAT DO WE WANT TO DO? We want to avoid work on weekends well even if it is funny this is pretty much right, lets check the business rule
We should not be able to select pickup date and shipment date when: We are on a layout type Assistance Service FR (dynamic layout value) And Field Issue du diagnostique= Dcision Pickup And Select the pickup date or shipment date that represents the original date and Filled in field Pickup code postal (pick up zip code) or Livraison code postal (shipment zip code) And You select the department number
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
49
A workflow rule is applied to calculate the final shipment or pickup date where the provider is committed with following definition:
DestinationZip code Days in Transit DestinationZip
code Days in Transit
01xxx 1 45xxx 1
02xxx 1 46xxx 2
03xxx 1 47xxx 1
04xxx 3 48xxx 1
05xxx 3 49xxx 1
06xxx 2 50xxx 1
07xxx 2 51xxx 1
08xxx 1 52xxx 1
09xxx 1 53xxx 1
10xxx 1 54xxx 1
11xxx 2 55xxx 1
12xxx 1 56xxx 1
13xxx 2 57xxx 1
14xxx 1 58xxx 1
15xxx 2 59xxx 1
16xxx 1 60xxx 1
17xxx 2 61xxx 1
18xxx 1 62xxx 1
19xxx 1 63xxx 1
20xxx 5 64xxx 2
21xxx 1 65xxx 1
22xxx 1 66xxx 2
23xxx 1 67xxx 1
24xxx 2 68xxx 1
25xxx 1 69xxx 1
26xxx 2 70xxx 1
27xxx 1 71xxx 1
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
50
28xxx 1 72xxx 1
29xxx 2 73xxx 2
30xxx 2 74xxx 1
31xxx 1 75xxx 1
32xxx 1 76xxx 1
33xxx 1 77xxx 1
34xxx 2 78xxx 1
35xxx 1 79xxx 1
36xxx 1 80xxx 1
37xxx 1 81xxx 1
38xxx 1 82xxx 1
39xxx 1 83xxx 2
40xxx 1 84xxx 2
41xxx 1 85xxx 2
42xxx 1 86xxx 1
43xxx 1 87xxx 1
44xxx 1 88xxx 1
HOW CAN WE DO? Simple: a workflow calculating our final date AND a Javascript that we will embed into a Global Web applet in the action bar.
DEFINE WORKFLOW
We need to create a workflow involving the shipment and the pickup start date to calculate the final date depending on the department rule and the original date:
Figure 53: Workflow formula to calculate final date depending on the department rule based on the original date
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
51
The workflow formula is the following:
IIf(Left([],2)='06' OR '07' OR '11' OR '13' OR '15' OR '17 'OR '24' OR '26' OR '29' OR '30' OR '34' OR '46' OR '64' OR '66' OR '73' OR '83' OR '84' OR '85' OR '98', []-2, IIf(Left([],2)='04'OR '05', []-3, IIf(Left([],2)='20', []-5, []-1)))
To understand: []: zip code []: Original date
DEFINE THE SCRIPT
The script will do following action:
Parse correct layout and get elements
Trigger the workflow rule (calculation)
If result is a week end, then alert the user
And finally add the next working day (correct date) The code that well need to use is the following (explanation are embedded with the code (marked as comment):
function startW (s, str) { return (s.match("^"+str)==str); } // keep date, parse and define variable new Date() function getDateFromOcodStringDate(sDate) { var v = sDate; var start = v.indexOf("/", 0 ); var j = v.substr(0,start); var m = v.substr(start+1,2); var a = v.substr(start+4,4); var d = new Date(); d.setFullYear(a,m-1,j); return d; } ///////////////////////////////////////////////////////////////////////////////
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
52
// Define day depending date function getDay( d ) { var weekday = new Array(7); weekday[0]="Sunday"; weekday[1]="Monday"; weekday[2]="Tuesday"; weekday[3]="Wednesday"; weekday[4]="Thursday"; weekday[5]="Friday"; weekday[6]="Saturday"; //alert("Today is " + weekday[d.getDay()] ); return weekday[d.getDay()]; } // alerte definition if result is a week end function isWeekendDay( d) { var weekday = new Array(7); weekday[0]="Sunday"; weekday[1]="Monday"; weekday[2]="Tuesday"; weekday[3]="Wednesday"; weekday[4]="Thursday"; weekday[5]="Friday"; weekday[6]="Saturday"; //alert("Today is " + weekday[d.getDay()] ); if( weekday[d.getDay()] == "Saturday" || weekday[d.getDay()] == "Sunday" ) return true; return false; } //////////////////////////////////////////////////////////////////////////// // Parse page function GetElement( id ) { if( document.getElementById(id) ) { return document.getElementById(id); } else { //alert("Not found Element by id : "+ id); return false; } }
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
53
function checkDates() {
// Get needed input values var type = GetElement('ServiceRequestEditForm.SR Type').value; var pick = GetElement('ServiceRequestEditForm.Indexed Pick 4').value;
// Keep field shipment zip code and pickup zip code var codePLivraison = GetElement('ServiceRequestEditForm.ZText_39').value; var codePPickup = GetElement('ServiceRequestEditForm.ZText_36').value; var result; // Check expected condition if ( type == "Assistance Service FR" && pick =="Dcision pickup" && codePPickup != "" ) { var dd = GetElement('ServiceRequestEditForm.ZDate_25').value; // format String date to Date var date = getDateFromOcodStringDate ( dd ); var oldDate = getDateFromOcodStringDate ( dd ); // Get the number of days to back from zip code date.setDate ( date.getDate() - getBackDayNumber (codePPickup) );
// We will Add 1 day if date is a Sunday and 2 days if date is a saturday if( isWeekendDay (date) ) { if(getDay(date) == "Sunday"){ // Add one day oldDate.setDate ( oldDate.getDate() + 1 ) } else { // Add two day oldDate.setDate ( oldDate.getDate() + 2 ) } // format new Date var nDate = oldDate.getDate() + "/" + (oldDate.getMonth() + 1) + "/" + oldDate.getFullYear(); // Message defined if date is a week end alert("Date Dpart pickup est un Weekend.\nNouvelle date pickup : " + nDate); // Change the date input value GetElement('ServiceRequestEditForm.ZDate_25').value = nDate; //return true; } } //////////////////////////////////////////////////////////////////////////////////////////// // We do the substraction with date.getdate() and getBackDayNumber (codePLivraison) and apply behavior. The substraction is done on the shipment and pickup date to let the workflow being applied. if ( type == "Assistance Service FR" && pick =="Dcision pickup" && codePLivraison != "" ) { var dd = GetElement('ServiceRequestEditForm.ZDate_26').value; var date = getDateFromOcodStringDate ( dd );
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
54
var oldDate = getDateFromOcodStringDate ( dd ); date.setDate ( date.getDate() - getBackDayNumber (codePLivraison) ); if( isWeekendDay (date) ) { if(getDay(date) == "Sunday"){ oldDate.setDate ( oldDate.getDate() + 1 ) } else { oldDate.setDate ( oldDate.getDate() + 2 ) } var nDate = oldDate.getDate() + "/" + (oldDate.getMonth() + 1) + "/" + oldDate.getFullYear(); // Message defined if date is a week end alert("Date Dpart Livraison est un Weekend.\nNouvelle date Livraison: " + nDate); GetElement('ServiceRequestEditForm.ZDate_26').value = nDate; //return true; } } return true; } ////////////////////////////////////////////////////////////////////////////////// // getBackDayNumber calculation: Define number depending postal code function getBackDayNumber( codeP ) { var code = codeP.substr(0, 2); if( code == "06" || code =="07" || code =="11" || code =="13" || code =="15" || code =="17" || code =="24" || code =="26" || code =="29" || code =="30" || code =="34" || code =="46" || code =="64" || code =="66" || code =="73" || code =="83" || code =="84" || code =="85" || code =="98") return 2; if ( code =="04" || code =="05") return 3; if ( code =="20" ) return 5; return 1; } ////////////////////////////////////////////////////////////////////////////////////////// // Detect the form where the script has to run function detectAddForm() { // Wait two seconds after changing the value type in the picklist because we are using a dynamic layout
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
55
// Check SR Type attribute if exist if ( GetElement('ServiceRequestEditForm.SR Type') ) { var elem = GetElement('ServiceRequestEditForm.SR Type'); try{ // Re-add the same method on this attribute every time the user choose different type, because when change SR Type the page is reloading and we lost Javascript Event
// addEventListener: all browsers except IE before version 9 elem.addEventListener('change',function (e) { setTimeout ( "detectAddForm()", 2000 ); }, true); } catch(e){ // attachEvent: IE before version 9 elem.attachEvent('onchange', function (e) { setTimeout ( "detectAddForm()", 2000 ); }); } } var e = document; e = e.getElementsByTagName('td'); // Parse HTML page to find Save button and change his behavior by Check Date function var i=0; while( i < e.length) { // Check SR form if( startW (e[i].id, "ServiceRequestNewForm") || startW (e[i].id, "ServiceRequestEditForm") ) { // Check Save button if(e[i].innerHTML == "Enregistrer" || e[i].innerHTML == "Enregistrer & Nouvelle Traitement" ) { document.getElementById( e[i].id ).onclick = function(e){ // Add check date functionality before saving if( checkDates() == true ) { // doNamedInvoke : default function used when clicking on Save button doNamedInvoke('Save', this); } } } } i++ ; } } // Run the script 2 seconds after action bar loaded //detectAddForm(); setTimeout ( "detectAddForm()", 2000 );
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
56
To understand:
ServiceRequestEditForm.ZText_39: Pick up zip code
ServiceRequestEditForm.ZText_36: shipment zip code
Assistance Service FR: picklist value that defines dynamic layout
Dccision pickup: value of the "type" field
Adapt and paste the code in a global web applet associated to the Action Bar and you will be done!!!
How to make caps mandatory for field content?
INTRODUCTION Data bases are being more and more integrate to business processes in the last years. Today interfaces, web marketing and many other functionalities are finding support on brut data base content. From the practical point of view what this introduces is the need for every system administrator to manage data quality.
BUSINESS CASES, WHEN MANDATORY CAPS ARE USEFUL Emailing on your data base contacts Imagine that you are sending marketing e-mails campaigns to all or a segment of your data base contacts. Imagine as well that you are merging some of the fields on the contact record profile you do not want to include orthographic errors which can bother your potential client, do you? If you say no, this how to is for you.
Time to result
10 Mins
Complexity (1 to 5)
Level 1,5
Gap with out of the box cap
100%
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
57
WHAT DO WE WANT TO DO? Just to push users to use ONLY a predefined set of characters when filling in a particular field.
HOW CAN WE DO?
STEP1: CREATE THE WORKFLOW EXPRESSION We need to use the Field validation capabilities. You need to add a field validation formula, which will define the allowed characters for the field. In this case, capital letters, numbers and some other symbols. Use the following expression:
Figure 54: Syntaxe dfinie dans la validation du champ
(FindNoneOf((FieldValue('')),"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-() _/")) = 0
To understand: can be replaced by any other field name!
FINDNONEOF FUNCTION EXPLANATION:
The FindNoneOf function in Expression Builder returns the position of the first instance in the first argument (string1) that does not match any character in the second argument (string2).
THE SYNTAX TO FOLLOW
The syntax to follow is: FindNoneOf(string1, string2)
RESULT TYPE
The result type is an Integer
STEP 2: SPECIFY THE FIELD VALIDATION ERROR MESSAGE
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
58
Once you have the validation expression, you can now create a message that will show up whenever users try to save a record not matching the established conditions. Here and example: Only capital letters, numbers, spaces and the characters period, parenthesis, dash, slash and underscore, can be used for the field Account Name, please modify your entry accordingly
How can I create an I-Frame in homepage?
INTRODUCTION This tip has often been used to personalize Oracle CRM On Demand application. This customization allows users to create shortcuts based on user business processes
BUSINESS CASES, WHEN A HOMEPAGE I-FRAME IS USEFUL I had a customer who wanted to personalize his application with the look of a Partner Portal. The aim of this customization was to create an I Frame in the homepage, embedding some quick links to main functionalities and most consulted information.
WHAT DO WE WANT TO DO? Your CRM could have this more attractive than the standard look:
Figure 55: I Frame in Homepage. Illustration from a customer
Or
Time to result
10 Mins
Complexity (1 to 5)
Level 2
Gap with out of the box cap
40%
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
59
maybe this one:
Figure 56: I Frame in Homepage. Illustration from a customer
CREATE A GLOBAL WEB APPLET Insert this code:
a:link {COLOR: #0033BB; TEXT-DECORATION: none} a:visited{COLOR: #0033BB; TEXT-DECORATION: none} a:active{COLOR: #0033BB; TEXT-DECORATION: none} a:hover {COLOR: #0033BB;TEXT-DECORATION: underline} Welcome to your s future application, what do you want to do today? Manage My Activity Manage Donations Get Help
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
60
Plan My Week Review My Business Plans View My Members All Donations My Donations Top 10 Donation
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
61
Find Messaging Plans Check MedInfo requests My Contact
To understand: Yellow : Color code to adapt Blue: Picture path Red: application path Green: Other links
Note: You can adapt the code inserting the expected picture and links. When configuring internal URL do not use any pod information so the code can be applied in many environments such as production or staging. This code has to be pasted in a global web applet as follows:
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
62
Figure: Global web applet to paste the I frame code
How can i create an i-frame with action bar content?
INTRODUCTION This tip will allow you to improve content shown in the action bar. We would like to customize the action bar letting only the most important information for business.
WHAT DO WE WANT TO DO? We want to create an I-frame in the action bar with scroll bar giving to users the capability to access to other non-standard functionalities:
Time to result
20 Mins
Complexity (1 to 5)
Level 1
Gap with out of the box cap
90%
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
63
Figure 57: Scroll bar in the action bar
HOW CAN WE DO? We will need to create global web applet into the action bar:
Figure 58: Web applet to create scroll bar
The code inserted is the following one:
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
64
We just need to be careful while specifying the size for the global web applet. After this, any link can be added to the action bar in order to facilitate the access to particular information to any Oracle CRM On Demand user in your company
How can I rename the button Log A Call in activity related information?
INTRODUCTION This tip shows you how it is possible to rename a standard button on your CRM application
BUSINESS CASES, WHEN RENAMING A STANDARD BUTTON IS USEFUL One of my customer wanted to renamed the out of box button log a call because the term call did not corresponded to his business language. SIince we cannot do that using standard customization capability we have found this workaround.
WHAT WE WOULD LIKE TO DO? We would like to rename the button Log A call into related information: Before:
Figure 59: Out of the box "Log a Call" label
Time to result
30 Mins
Complexity (1 to 5)
Level 3
Gap with out of the box cap
10%
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
65
After:
Figure 60: Label "Log a Call" after applying modification code
HOW CAN WE DO? We will create a Web applet that we will embed into the contact layout with the following code:
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
66
Figure 61: Code to paste in a web applet to change the "Log a Call" label
Put this web applet on the concerned layout:
Figure 62: Web Applet embedded to modify "Log A Call" label
Code to paste:
var td = document.getElementsByTagName("td"); for (var i = 0; i < td.length; i++) {
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
67
if (td[i].innerHTML == "Log A Call"){ //alert (td[i].innerHTML); td[i].innerHTML = "Send Email"; } if (td[i].innerHTML == "RenommerBtnConsignerAppel"){ td[i].innerHTML = ""; } } var a = document.getElementsByTagName("a"); // Code is for the . This part is to hide the related information title if (document.getElementById("AIIA-RQVJL_Title")) { document.getElementById("AIIA-RQVJL_Title").innerHTML = ""; document.getElementById("AIIA-RQVJL_Title").innerText = ""; }
To understand the code:
Yellow: the old value
red: le new value
Blue: name of the related info if you want to remove it
Green: ID of the related information you want to remove
Note: if you want to let this code flexible, working on different environments such as production and staging, just add, before :
// Code is for the . This part is to hide the related information title if (document.getElementById("AIIA-RQVJL_Title")) { document.getElementById("AIIA-RQVJL_Title").innerHTML = ""; document.getElementById("AIIA-RQVJL_Title").innerText = ""; }
To understand the code:
Green: ID of the related information you want to remove
How can I create an information bubble on 1 or many fields?
-
Ch
apte
r: G
ENER
AL
CO
NFI
GU
RA
TIO
N
68
INTRODUCTION A mouse over functionality is today a very used web behavior. In many CRM on the market you can see this type of functionality available. We couldnt let Oracle CRM on Demand users without this workround which cover this requirement and make easier the application adoption!
BUSINESS CASES, WHEN THE INFORMATION BUBBLE IS USEFUL I think that all of my prospects and customers asked us at least once this functionality. Information bubbles will help users to understand a field meaning and/or purpose and so, to adopt the application faster.
WHAT DO WE WANT TO DO? We would like to create a mouse over functionality based on the field display name:
Figure 63: Information Bubble with text
Or on an image:
Time to result
30 Mins
Complexity (1 to 5)
Level 3
Gap with out of the box cap
10%
-
Ch
apte
r: G
ENER
AL
CO