You are on page 1of 33

!

Sales CRM!
Customer Relationship Management!

!
!

CONTRIBUTED BY ADAXA, AUSTRALIA!


enhanced by Redhuan D. Oon!
sponsored by Zeeshan Hasan, SYSNOVA, Bangladesh!
THIS IS A DOCUMENTATION ON HOW THE UPGRADED SALES CRM
PLUGIN WORKS AND HOW YOU CAN IMPROVE IT AS AN OPEN
SOURCE PROJECT. PLEASE RESPECT CONTRIBUTORS BY GIVING
THEM CREDIT IN YOUR IMPROVED WORK AND SHARE THEM BACK
TO THE PUBLIC DOMAIN UNDER GPL V2.0!

!
!

THIS DOCUMENTATION IS PART OF A SERIES TO MAKE SURE ERP


SOFTWARE IS CONSTANTLY REVIEWED, IMPROVED, TESTED AND
DOCUMENTED OPENLY AND MADE EASY TO USE. PLEASE SUPPORT
ME BY DONATING TO MY PAYPAL RED1(AT)RED1(DOT)ORG TO MAKE
MORE OF THIS POSSIBLE. THANK YOU FOR USING FREE SOFTWARE.!
!

I STARTED WRITING THIS DOCUMENT IN RANGSIT DISTRICT OF


BANGKOK, THAILAND ON APRIL 5, 2016, WITH HIEP LE QUY STAYING
AT NAKARATS HOME, A LOCAL SAP CONSULTANT AND SUPPORTER
OF IDEMPIERE FREE ERP IN THAILAND AND LAOS.!

!
!

VERSION 2 - APRIL 11, 2016 - KUANG MALAYSIA!


VERSION 3 - MAY 26, 2016 - CHART MAKER AND EMAIL HANDLING!
VERSION 4 - MAY 30, 2016 - SALES FUNNEL CHART

!
!
!

sponsored by

BANGLADESH
!

RED1s THREE LAWS:


Information is Free
YOU HAVE TO KNOW

People are Not


YOU HAVE TO PAY

Contributors are Priceless


YOU HAVE TO BE

ADAXA, SYSNOVA

Sales CRM

!
!
SALES CRM NOW WITH SEXY CHART-MAKER!!
!

!
Manage your sales team and
business in Calendar view.
Make Fast Powerful Charts on
the same page with Sexy Chart
Maker - formulas provided in
this illustrated tutorial
Generate Leads and Sale
Orders on the fly.
Super-fast plug and play
modules.
Well documented examples
Fully compatible, with no
impact to core of the best
amazing free ERP iDempiere.

Page 3 of 33

Copyright (C) 2015 Redhuan D. Oon

ADAXA, SYSNOVA

Sales CRM

SalesCRM and ChartMaker plugins are built on top of a MAJOR Contribution by Steven
Sackett and Paul Bowden of Adaxa, Melbourne Australia that made it into the core of
iDempiere. The plugins presented here are independently developed and work perfectly
without any screeches. Plug in and out with ease of mind thanks to OSGi framework
adopted by iDempiere.!

!
Links!

!
!
1.
!

Original ADAXA Sales CRM module - http://wiki.idempiere.org/en/NF2.0_CRM!

2. Resources - http://sourceforge.net/projects/red1/files/SalesCRM/!
!

a. AdaxaSalesManagement.pdf!

b. AdaxaDashBoardGuide.pdf !

Plugin I!

c. org.crm.sales.<time-stamp>.jar - Binary Plugin with 2Pack included!

3. Forum with movies links - http://red1.org/adempiere/viewtopic.php?f=45&t=1822


!

4. !

Plugin II !

Page 4 of 33

!
Chart-Maker - http://sourceforge.net/projects/red1/files/ChartMaker/

Copyright (C) 2015 Redhuan D. Oon

ADAXA, SYSNOVA

Sales CRM

!
!
!

Table of Contents!

!
!
!
Features List!
Adaxa!

6!

New!

6!

Try It Now!
Step By Step!

Lead to Closing Sale!


Generating a Lead!

7!
7!

9!
9!

Lead Request Window!

10!

Close the Sale!

11!

Generated Sales Order!

12!

Sales Order On The Fly!

13!

Managing Leads!

14!

Convert Lead to Opportunity!

14!

Sales Stages!

15!

Business Intelligence!

16!

Sales Rep Dashboard!

16!

StackedBarChart!

17!

Drill Into Chart Link!

18!

3D Stacked Bar Chart !

19!

Meeting Activity !

20!

Bonus Chart Maker!

21!

Sales Funnel Chart!

25!

Non-Time Category Column!

26!

Email Handling!

!
!

6!

27!

Client Email Test!

27!

Request Email Processor!

28!

Fine-Tuning Email Processing!

31!

Request Process Engine!

32

Page 5 of 33

Copyright (C) 2015 Redhuan D. Oon

ADAXA, SYSNOVA

Sales CRM

Features List!

Adaxa!
1. Dashboard !
1.1. Charts Setup!
1.1.1. My Sales Pipeline!
1.1.2. My Opportunities By Campaign!
1.1.3. Sales YTD!
1.1.4. My Open Requests!
1.2. Leads View!
1.3. Opportunities View !
1.4. Activities View!
2. Leads Conversion to Opportunities Process!
3. Documentation on how the charts are setup and how the sales functionality
works.!

!
New!

1. Dashboard Calendar Timeline View and Action Clicks!


1.1. Generate Leads and Sales Orders on the fly!
1.2. Activity Meeting generate Request on Calendar!
1.3. Colour coded Request Type for easy viewing!
2. Leads window added with Requests tab for quick data access!
3. Mail Campaign activity integration!
3.1. Incoming mail mapped to Leads/Sales Requests for fast tracking of
email correspondence with prospects and sales.!
4. FitNesse Testing and this documentation !
5. Bonus Chart-Maker in separate plugin (see http://red1.org/adempiere/viewtopic.php?
f=45&t=1826)!

Page 6 of 33

Copyright (C) 2015 Redhuan D. Oon

ADAXA, SYSNOVA

Sales CRM

Try It Now!

!
Step By Step!

1. Take from Links, the downloaded plugin (2.c) and save in any location inside your
computer.!
2. Launch your iDempiere-server and access your Felix console (click on the gear icon
of the first browser display). Login credentials should be SuperUser/System.!

3. Click on the Install/Update button and Choose File for your plugin.!

4. Select Start Bundle and OK the


Install or Update button on lower
right.!
5. Go to your browser and login to the
ZK user interface as GardenAdmin
with password also GardenAdmin!

!
!
!

Page 7 of 33

Copyright (C) 2015 Redhuan D. Oon

ADAXA, SYSNOVA

Sales CRM

6. Choose GardenWorld and HQ and


you will find the Calendar Dashboard
on the screen as shown below. !
7. Clicking on any date in the calendar
will open an Event window. Note that
the Request Type is defaulted to
Sales Lead. If not, that means your
2Pack for some reason did not fire
up and pack in automatically when
the plugin was installed. (You can
collect the SalesLeadCRM.zip 2Pack
separately from the link above.!

Page 8 of 33

Copyright (C) 2015 Redhuan D. Oon

ADAXA, SYSNOVA

Sales CRM

Lead to Closing Sale!


Generating a Lead!
Now you are ready to generate a Lead. In
the pop up Event window you can use the
Summary box to send commands to
iDempiere to generate a Lead record. Paste
in the text replaced with your own:!
C=Redhuan,K=red1,T=603-178869-378, A=Lot
2906,A2=Lorong
Beringin,
E=red1org@gmail.com!

The following act as key guide what each


code means:!
C = Prospective customers name!
K = Key or search value!
T = Telephone number!
A = Address 1!
A2 = Address 2!
E = Email!
Minimally you just need C and K to make it.
They will be used to create a User record. If
email code is defined it will be used as a selfservice login for the new prospect to go into
your system (if it is online over the Internet)
and conduct self service
activity.!
Once you click on the Save
button at the bottom it will
close and an item will be
linked to the Calendar date
you chosen. It is colour
coded green. So now you
have a Request ticket
created on that date which
you can access this ticket
via email and be tracked
until its disposed off by
closing it. It also act as a
timeline visual cue of your
activity at one glance. When
you clicked on it again you can Zoom onto the Request detail.!

Page 9 of 33

Copyright (C) 2015 Redhuan D. Oon

ADAXA, SYSNOVA

Sales CRM

Lead Request Window!


Clicking on the Zoom button above will open the Request window but as a sub tab under the
Lead Window. You can then easily switch to the parent Lead tab to view the newly created lead.
The Lead window is actually based on the AD_User model. So all the data there can be found
inside the AD_User table in the database.!
Developer Note: You may wonder how this Zoom to a specific window happened. Read further
from http://wiki.idempiere.org/en/NF1.0_Dynamic_Zoom. You can login as SystemAdmin and
look at the R_Request window to see that i have added into the Zoom Condition:!
'Y'=(SELECT IsSalesLead FROM AD_User WHERE AD_User.AD_User_ID = R_Request.AD_User_ID)!

This value AD_User_ID was set by the plugin into the R_Request record.!

The Activity tab was put there by Adaxa. What I done is only to add the Requests tab so there is
no need of changing present models and thus no impact to any core model or design. !
So from here onwards, usually the sales process involves activities such as meetings, emails,
and research work. In between, the Lead maybe converted into an Opportunity which is shown
in another window. From there on, it goes through a Sales Funnel process. More on that later.
For now lets say you are a super sales man like Donald Trump and go for the close.!
The next step which I have added as a new feature will do that. One reason I am bringing this
forward is also to differentiate what is done onto the great underlying Adaxa work here.!

!
!

Page 10 of 33

Copyright (C) 2015 Redhuan D. Oon

ADAXA, SYSNOVA

Sales CRM

Close the Sale!


Again, like the Request generated Lead
record, the Calendar Dashboard can also
trigger a Sales Order. Look at the screen
example. Make sure you put the
RequestType as Sales Order.!
The text I used is !
C=Redhuan,P=Seeder,Q=25,$=25.!

C like before is the clients name. P here


stands for Product, Q is quantity, $ is price.
As before, you can go with just the minimal
C and P without qty and price which will be defaulted to 1 and the price picked up from the
BPartner Group PriceList (This means you have to make sure your Standard Customer Group
has a PriceList selected. Otherwise it will hit a not saved error.)!
If $ Price is set, it will be the price you intend to offer compared to the standard listed price. The
Sales OrderLine will calculate and record the discount you are giving right away.!
The amazing thing about this is that you can even use this for previous customers. Try it out on
JoeBlock. Another amazing thing is that you need not spell the name of the customer or product
entirely in full. I have made the matching to be done to the closest match. So Joe and Seed
should be enough to get it going. But if there is a multiple match, then the first in alphabetical
order is taken. So make sure you specify enough text to get a unique exact match.!
If the customer has not existed before (User record not created) it will also report an error. So the
best way is to make it as a Sales Lead easily as it will create its Location and Email login at the
same time, saving you the need to do all those preliminary user and customer registration into
your ERP system.!
Another good thing we are able to do is that the dates are mapped from the Request. The
DateOrdered and DatePromised are taken from the StartPlan and CompletePlan dates of the
Request.!
After saving it, you will find
on the calendar another
item this time in blue. Click
on it to pop-up and click on
its bottom left Zoom button,
and it will open up another
request, but go down the
window and you will see
another amazing thing.!

!
Page 11 of 33

Copyright (C) 2015 Redhuan D. Oon

ADAXA, SYSNOVA

Sales CRM

Generated Sales Order!


The Request ticket generated under a Sales Order RequestType will have its Order linked to the
Request you just opened. !

Click on it to look at your Sales Order.!

!
Note the Product, Qty and Price information is as you entered during the Request ticket.
Remember that you could do away with Qty and Price if it is meant only for 1 at group price list.
And remember also that you can generate such a Sales Order on the fly for previous customers.
On top of saving time, you get a calendar ticket to track your order. This is useful visual cue for
your down the line operations, such as inventory picking and delivery task. I am going to add
another feature which is an Invoice paid status will close this ticket! In that way you can easily
keep track of your open books. !

Page 12 of 33

Copyright (C) 2015 Redhuan D. Oon

ADAXA, SYSNOVA

Sales CRM

Sales Order On The Fly!


As promised, you can also do a Sales Order
on the fly by its own, without referring to a
new Lead. Take the following example. It is
putting in a Garden-World person, Joe
which is like Joe Block and got that record
out, with a generated Sales Order of item
like Hoe default to 1 qty at given price list.!
I also made the hash codes not to be case
sensitive. But the values have to be.!
The Request record has the
Sales Order record attached.
Since it is not a Lead, but a
present record, the zoomed
Request window is a
standard one.!
The attached Order below
looks in proper order. Now
this is yuuggee! :)!

!
!
!

!
Page 13 of 33

Copyright (C) 2015 Redhuan D. Oon

ADAXA, SYSNOVA

Sales CRM

Managing Leads!
Convert Lead to Opportunity!
Leads are just leads. They are not qualified yet. They need to go through a process of meetings,
presentations, pitches and solicitation of a response. Once there is a probable interest that
moves them from zero probability towards a buy decision, they can be converted to an
Opportunity. Then only will they show up in the Dashboard or the radar screen of the Sales Rep.
This originally as done by Adaxa which is really great as it is, still to me is a bit of a weakness
because what happens to all the other leads? That is why the use of the Calendar that manages
requests and SalesLeads tickets is a good idea to keep them in another radar screen. The Sales
Rep can have a nice view by flipping the Calendar, or make their own report of open lead tickets
via the Request window. I have also made that when the Lead is converted to an Opportunity,
the attached Request ticket is then formally closed. Sales reps are busy people whose business
is not to learn a software but to sell, sell, sell. They need this sales tool to be fast, efficient and all
in at a glance.!
To convert a lead into an opportunity, you can do it from the Lead window. At the process icon on
the top menu bar, click on it, to see a Convert Lead as shown on the screen below.!

Note right at the bottom left, is the BP Name. The


new BusinessPartner record created by the
ConvertLead will take that name. This is useful if
the Company name is different from the user
name. I superimposed the pop up box to fill in the
details. On OK, a box with links to the generated
records will pop-up.!

Page 14 of 33

Copyright (C) 2015 Redhuan D. Oon

ADAXA, SYSNOVA

Sales CRM

!
Sales Stages!
According to AdaxaSalesManagement.pdf on the last page 13:!

I recreated the same details as above into the System client Sales Stage window so that all
clients can use them. I further endorsed it with descriptions:!

Each stage has respective probability which will affect the Expected Amount as can be seen on
the next screen showing the Dashboard. In the above screen, you can see the sub-tab showing
the Opportunities for each Stage. The one we just created is shown above under Active
Discussion. The Lead windows Lead Status will also be updated to Converted.!

Page 15 of 33

Copyright (C) 2015 Redhuan D. Oon

ADAXA, SYSNOVA

Sales CRM

Business Intelligence!
Sales Rep Dashboard!
After generating a few Leads and converting them we can see the following when we pull up the
Sales Rep Dashboard from the Sales Management menu. The Sales PipeLine chart gets data.!

You can assign a Campaign to the Lead before


converting. Or you can do so in the Opportunity
window if hadnt done so. Then they will also
appear in the My Opportunities by Campaign
chart.!
The Sales YTD chart will only get data when
you have enough sales orders for the client in
this case GardenWorld. This chart is therefore
general to the whole company and is shown on
all dashboards. The two My charts above are
private to the user alone and will show up only
for that user. You can of course edit this or add
more charts by going into SystemAdmin and
haul up the Chart window and its Chart
DataSource tab to examine how they are set.
The code that handles this can be traced or
debug from org.adempiere.apps.graph/
ChartBuilder.java. You can get source code
guidance from online resources such as http://www.tutorialspoint.com/jfreechart/.!

!
!
Page 16 of 33

Copyright (C) 2015 Redhuan D. Oon

ADAXA, SYSNOVA

Sales CRM

!
StackedBarChart!
Noticed that the MySalesPipeLine is not as it is shown by Adaxas
image? You can check under SystemAdmin at the Chart window for
MySalesPipeLine. Zoom in into the ChartType:!
Indeed the Chart chosen is StackedBarChart instead of the normal
BarChart. What is showing in our example is BarChart. !
I checked the source code and it is in org/adempiere/apps/
ChartBuilder.java, line 510:!

Note the highlighted BarRenderer. After some online checking for the right code I found one
interface which I then apply:!

When refreshed, the MySalesPipeline chart turns out as shown on the right as compared to the
old one on the left. I have submitted this simple fix as a patch at IDEMPIERE-3069.!

Page 17 of 33

Copyright (C) 2015 Redhuan D. Oon

ADAXA, SYSNOVA

Sales CRM

Drill Into Chart Link!


At the above chart, you can double-click on any bar
and it will drill into the underlying data! That works
on any chart you see. A chart is linked to its table
source window and showing only the data as
specified in its SQL WhereClause. So lets try taking
a look at the My Opportunities By Campaign chart
First just hover the mouse over the chart:!
You will notice that a display appears stating the
total value of the category. When you double click
on it, it will open up the
Campaign window and
showing all the same
campaign records, which
totalled at its Opportunity
Amount as the same
$19,000 value.!
Then we go to the
Stacked Bar Chart and
click on the first Active
Discussion bar. It opens
up the Opportunity one
we converted earlier.!

!
!

!
These two powerful charts as done by Paul Bowden, with specifications defined under the
subject matter expertise of the brilliant accounting mind of Steven Sackett is absolutely high
value to many serious businesses. They can be contacted at ADAXA of Melbourne, Australia for
ERP project consulting at www.adaxa.com. !

Page 18 of 33

Copyright (C) 2015 Redhuan D. Oon

ADAXA, SYSNOVA

Sales CRM

3D Stacked Bar Chart !


The JFreeChart employed and setup
in the ChartType by Paul Bowden
covers the full range including the
very attractive 3D Stacked Bar Chart.
You can login as SystemAdmin and
go to the Chart window and select
that as ChartType.!
Then, login again as GardenAdmin to
view the same dashboard again.!
!

You can see in the original Adaxa wiki writeup - http://wiki.idempiere.org/en/NF2.0_CRM, they
have another chart My Opportunities by source and campaign. This should not be hard to do.
Just follow the DataSource definition in My Sales Pipeline and incorporate into this new chart.

Page 19 of 33

Copyright (C) 2015 Redhuan D. Oon

ADAXA, SYSNOVA

Sales CRM

Meeting Activity !
One of the fun part for the CRM is to manage activities. Under the Lead window there is an
Activities sub-tab where you can begin to assign your actions onto the Lead or User, such as
organising a Meeting. !

!
So in this case, we are
setting a meeting and we
have to give an End Date
besides the Start Date so
that a request ticket will
appear on the dashboard
calendar at this same
times. The result of the
save of this window is as
shown on the right here.!
Note the colour coding and
the Summary details has
taken from the Description
earlier and crafted a
readable message.!

Page 20 of 33

Copyright (C) 2015 Redhuan D. Oon

ADAXA, SYSNOVA

Sales CRM

Bonus Chart Maker!


Now you can have the powerful 3D StackedBarCharts generated on the fly! Using only a single
inline in the Red1's Aladdin signature style, the ChartDatasource lines will be done for you for
column value breakdown such as by Product, or by SalesRep or by Location or by virtually
anything. The plugin is a separate standalone plugin described here http://red1.org/adempiere/
viewtopic.php?f=45&t=1826 called the Sexy Chart Maker.!
Download the plugin from http://sf.net/projects/red1/files/chartmaker!
After installing and its automated pack-in, you will find in both System and Client logins the
Chart-Maker item in the main menu. This can be used in System for defining charts for all users
or a respective Client use only. The cool thing about using under Client side, is that you can
have a seamless toggle effect to switch from Chart-Maker to your generated chart almost
instantly.!
When you open the Chart
Maker window, you can fill in the
exact details as shown here.!
ChartName = Sales YTD. This
will match the exact Chart
defined in the system. If you
give another name it will create
a new one instead and you can
link to it in the SystemAdmin
Table and Column window
under the Column tab at the
Reference field.!
Time = Month. There is option
of Day, Week and Year which i
welcome testing as I have not
tested those yet. Table = C_OrderLine is the base data that the Chart will refer to. In this case is
all the Sales lines data. Category Column = DateOrdered is the vertical column value which will
be subjected to the Time range. If no Time range given, each value will be a category column.
Thus in theory you can define different vertical bars. I also appreciate feedback on testing this. !
ValueBreak = LineNetAmt>M_Product.M_Product_ID is the most interesting one. It is the colour
code breaking value on each vertical bar. The formula is [Value]>[Table][dots][optional tables]
[dot][lasttable][dot][Column_ID] where the last table Column_ID is the breaker. Thus the formula
given is saying Take the sum of LineNetAmt from C_OrderLine records, and break by
DateOrdered and by M_Product_ID of the M_Product table joined to the previous table. The
plugin will automatically make a SQL Join between C_OrderLine and M_Product tables with

Page 21 of 33

Copyright (C) 2015 Redhuan D. Oon

ADAXA, SYSNOVA

Sales CRM

their aliases set alphabetically. Go to Sales


Rep Dashboard, to see the result as shown
on the right.!
Next toggle back to the Chart Maker tab and
enter a different value for ValueBreak =
LineNetAmt>C_Order.C_BPartner_ID. Toggle
back and refresh again to see a different
chart below.!
What about the Sql WHERE value? It is
important or else all data records of
C_OrderLine will be displayed including those
from purchases, open or draft orders and
even void ones. Now that worry is taken away
completely. !
See the setting below. !
Sql WHERE = b.DosStatus IN (CO,DR) AND
b.AD_Client_ID = @#AD_Client_ID@ AND
b.IsSOTrx=Y.!

It is the similar to Sql WHERE style in actual


DataSource tab of Chart model. But here is
the trick. Whatever new models you put in
Sql WHERE is created in ChartDatasource
Sql FROM. Initiate these new models in
the ValueBreak statement as [dot][table].
Then each table after the base Table is
referred to alphabetically in its alias value. The Sql WHERE statement can take a context value
in the form of @#<context variable>@ as standard in Compiere. !

Page 22 of 33

Copyright (C) 2015 Redhuan D. Oon

ADAXA, SYSNOVA

Sales CRM

Below is the generated Chart Datasource. Note how much tedious work is magically taken away. !

Just manipulate the last two fields, ValueBreak and Sql WHERE in the Sexy Chart Maker and
produce any 3D StackedBar Chart you or your sales team can dream of.!
Remember the earlier chart that uses !
!

ValueBreak = LineNetAmt>M_Product.M_Product_ID ? !

In order to use the Sql WHERE used above, it is now defined as !


!

ValueBreak = LineNetAmt>C_Order.M_Product.M_Product_ID !

See it in the screen-shot below. Now the ValueBreak has an additional table in it, C_Order. The
Chart Datasource Sql FROM will be injected with a JOIN for it with a subsequent alias, b for the
Sql WHERE to refer to.!
This is my simple but
working and proven
example that I have made
to show the power of the
Sexy Chart Maker. The
way I wrote the code, it will
allow any elaborate Sql
WHERE clause as long as
you put the reference
tables in the ValueBreak.
You can always examine
the Chart Datasource table
to see the generated
results in order to
understand it more deeply.

Page 23 of 33

Copyright (C) 2015 Redhuan D. Oon

ADAXA, SYSNOVA

Sales CRM

Now we have to solve one more matter to make the Chart a real marvel. When you mouse-over
any bar you will see a pop up reference displayed. !
When you double-click on it, it shall drill
into its underlying data source. As long
as the table has an associated parent
Window to it. But for C_OrderLine there
is none as its parent window is Sales
Orders (C_Order). It will hit a blank
Sales Order window with error. Solving
this is very simple. Just create a new
Window singularly and exclusively for
C_OrderLine. Define for it, a single tab
with a Tab-Table set for C_OrderLine.
Then go to Table and Column for
C_OrderLine, set its Window to point to this new window Order Line. !
Now Login back to Client and click over any bar will give exact set of C_Orderlines with matching
LineNetAmt, 27.00 + 13.50 = 40.5.!

Since I have made this Chart Maker as a separate plugin, it can thus be used on its own and for
any definition of data model. Again, I will love to hear from you and better if you can contribute
your charting effort based on this Chart Maker.!
One last thing, you need not remember any of the previous values you put in as you began
toggling to different charts. Recall the Saved Parameters at the bottom of the any process
window! You can even save them as a labelled set to reuse in future.!
!

!
!
!
Page 24 of 33

Copyright (C) 2015 Redhuan D. Oon

ADAXA, SYSNOVA

Sales CRM

Sales Funnel Chart!


Using this magical Sexy Chart Maker, I can
easily generate a new powerful chart to show
the Opportunities in a funnel of Sales Stages
and according to the their ExpectedCloseDates
by month. You have to convert a number of
sales Leads quickly first by generating Leads
from the Calendar Dashboard and in each Lead
window select Convert as shown in this tutorial.!
This is how my Dashboard Calendar looked like
after a blitz of leads.!
The converted to
Opportunities are in the
next screen-shot.!
Now call up the Chart
M a k e r, a n d f e e d t h e
following values as shown
below. Press OK to run the
process and the chart is
generated. You can replay
all Saved Parameters to
toggle between any chart
like magic. Copy paste from below:!
ExpectedCloseDate!
OpportunityAmt>C_SalesStage.C_SalesStage_ID

Page 25 of 33

Copyright (C) 2015 Redhuan D. Oon

ADAXA, SYSNOVA

Sales CRM

Non-Time Category Column!


You will notice that the generated charts so far are time based i.e. for monthly stacks. We can
also define other Category Column and one example is done here for Opportunities according to
Campaign and Sales Stages.!

This is displayed in the Sales Rep Dashboard side by side with the Sales Pipeline which is the
same data sorted by month. Below is the formula in the Chart Maker process dialog. Notice how
simple it is. b.Name refers to 2nd table, C_Campaign. And remember you can rename each
stored parameter set for easy toggling between charts in the same Chart name. Remember your
Chart name can be changed in the SystemAdmin window table column reference.

Page 26 of 33

Copyright (C) 2015 Redhuan D. Oon

ADAXA, SYSNOVA

Sales CRM

Email Handling!
Imagine your business needing to send out emails to sales leads daily or receiving countless
emails from inquiries who read your advertisement. You may also be sending out through the
Mail Campaign window and such subscribers want to respond to some offer. Imagine checking
into your ERP dashboard and see all those emails contents arranged nicely under each Lead?!
Now I have put in some more magic plugin code so that your server can check those incoming
emails, record them as CRM Request Tickets, and consolidate them under same email requests,
and show up in the respective Lead window under respective User accounts. !
Originally I thought it would require a change within the core - http://idempiere.atlassian.net/
browse/IDEMPIERE-3109. However, since i have often preached that core should best be left
alone to ensure negligent extra maintenance by any implementor or users. What more, it may
break some compatibility in others. Finally I figured it out and the final solution to it was less work
than I thought.!

Client Email Test!


You will need a new email account as it can be dangerous to use your own private email
account. Usually the new email will be a bulk email reference which prospects will communicate
with. Please refer to my forum for details on how to enable IMAP in your gmail.
Once that is done, in your Client Admin, go to the Menu > Client window. You can now put in
your email settings to test if it works with your server. You have to be online in order to do that.!
Implementor note: This Client Email setup is for the Request Processor engine to use the email
service. It is not needed by the Request Email Processor which processes incoming emails.!

Page 27 of 33

Copyright (C) 2015 Redhuan D. Oon

ADAXA, SYSNOVA

Sales CRM

Request Email Processor!


This is the only thing you need to get the
incoming email going. Run this and it will
fetch email sent by your prospects or leads
and customers to your mailbox. Each email
once processed will be moved to another
folder in your mailbox. You can define them
as shown on the right.!
The bottom half is when you want to group
the resulting Requests under any specific
values where filled in.!
The IMAP Host if gmail can be just
imap.gmail.com without the port 993
because the EMailSvr code has got it
hardcoded as default for gmail. I am putting
there to show how you will define another
port. Using own port hits a bug but i have
submitted a tracker and Hiep has
contributed a better patch than mine -!
http://idempiere.atlassian.net/browse/IDEMPIERE-3106. Apply it if it is not applied in latest core.!
The Request Folder is the successfully processed folder. The Inbox Folder is a sub-folder where
you filtered your emails into. I marked my sample as SalesLeadCRM in its content so that they
get filtered into a request folder. If something went wrong in the code or processing, emails that
failed will be placed in an Error Folder. Their original copy still remains in the Inbox Folder.!
Each email will be checked if its originally
new and if so, a new Request record will be
created for it, and its details copied into the
Request. If the email sender is new, you can
manually but easily turn each into a Lead
using the dashboard calendar action. In my
case, I created it easily by having the email
specified. Now future email correspondence
will do a search for such an email in the User
records and assign the User ID to them.!

Developer note: You have to put in your SuperUser User window its email address in order for
the Request Email Processor to set the user id in the Request window. In my case it is
amazingerp()gmail()com!

Page 28 of 33

Copyright (C) 2015 Redhuan D. Oon

ADAXA, SYSNOVA

Sales CRM

You can use your mailbox to continue corresponding with your target recipients and each email
whether to or from will be filtered into your Inbox Folder and when run in this processor, will get
them associated. Shown on next page is the new Request under the Lead window. In this way,
you will have a singular window reference. Imagine each morning just going to the dashboard
calendar and clicking on your new lead set before will lead you to this Lead window and you can
check if your company server got any email from them. The Last Result field will tell you whats
the latest on your last email thread. If there is new email, it will be a new Request added to the
tab under the Lead window. !

!
If you go to the Request (normal window) you will see under the Update tab all further
correspondence to and from your company server with that lead or customer.!

Page 29 of 33

Copyright (C) 2015 Redhuan D. Oon

ADAXA, SYSNOVA

Sales CRM

In the above case there are 4 updates or 4 emails sent to and received from in total. The normal
Request window will also show that its RequestType is set to Email, so that it can be
differentiated for any further specific routing or process you want to do to it.!

!
By executing a new or any action on this Request will then send out an email from your company
to that lead or customer. That will end up in a new Request. If you intend them not to be new
requests but just updates under the original request as shown in the last screen-shot, then just
use your company email to correspond as replies to each other.!
Such options should be good enough for most CRM to mail integration. With its open source
code which i made well written, documented and uploaded in public domain, any developer or
implementor should be able to extend its power even more, and share for a greater wholesome
software.!
If you intend to see all updates under the Lead/Request window, then in System Admin, just add
the RequestUpdate tab to it, linked to its parent Request ID. For many users, this improvement
and email integration feature already gives a tremendous boost to what iDempiere can do.!
Developer note: You have to run the RequestEmailProcessor after each round of receiving
replies from responders as their emails maybe replies and they will be updated into same
Request as appended update (this is legacy behaviour from RequestEmailProcessor and not
due to my plugin). Running them often is advisable. At least before commencing next round of
your own replying. If you fail to do so any more rounds of replies will not be consolidated to same
Request but a new Request will be created. However my plugin ensure they are of same Lead.!

Page 30 of 33

Copyright (C) 2015 Redhuan D. Oon

ADAXA, SYSNOVA

Sales CRM

Fine-Tuning Email Processing!


There are ways to fine tune your Requests as
they are processed. In the Request Processor,
you can route your Requests to different
personnnel depending on the keyword
encountered in the Summary.!
You can have arbitrary User/Contact to route to
for example, Meet, Sold. SendBrochure that
denotes an action where further plugin code
handling can trigger further automatic action
within the system. Or just route to personnel
directly where they handle accordingly.!
(Developer note: My future dream task is to
utilise the magic of JBoss Rules or Drools
engine, which in previous month has me and
Hiep successfully integrated into iDempiere as a
plugin set. The idea of Drools is to use an external Excel spread-sheet to define business rules.
Thus the plugin engine will send arguments to that sheet and receive responses such as true/
false or dynamic values. It is basically if [conditions] return [results].!
In this email handling case for example, the options of action to take on each email will be stated
in the sheet, i.e. [results] = Send X Info, Send Quote, Ship Product. Another more detailed
Drools sheet will handle exact document processing i.e. [ship product] = [get tax, complete SO]
and to handle tax [check tax rate] = [read tax rules] and so on. It is progressively putting all code
into spreadsheets! Will be fun to take it on.)!

Page 31 of 33

Copyright (C) 2015 Redhuan D. Oon

ADAXA, SYSNOVA

Sales CRM

Request Process Engine!


This engine is as old as Compiere itself. It has always been there, but in iDempiere, we turned it
off as most users do not use them. In order to use it, you have to look for the Request Processor
window under your Client Admin and activate it by checking the Active box. Then you have to
setup the Client email as shown earlier. !

After those have been done, when you restart your application server, you can get to the Server
Monitor by clicking on the right-most icon in the root menu:!

Page 32 of 33

Copyright (C) 2015 Redhuan D. Oon

ADAXA, SYSNOVA

Sales CRM

It will open up the Server Monitor below. Note the Client Request Processor running status
among the list of processors.!

!
Developer note: In fact this Request Processor does the work of creating new RequestUpdates
to the same Request. Thus if this is turned on, you need not use the Sales CRM plugin. But with
the plugin, it will ensure that the Requests are set to the right User and RequestType. So do not
worry whether the plugin is creating things twice because the plugin code does check for
duplicates and not create the same Update again. Smart of me eh?!
Developer note: However with the processor on, it will still automatically send out emails
notifications to recepients. So if this is the case, you have to create a filter in your request folder
of your inbox to ignore mail coming from your own server. Or manually delete all such update
emails.!

Page 33 of 33

Copyright (C) 2015 Redhuan D. Oon

You might also like