When a caller calls into the office PABX System, it shall trigger the Flash Operator Panel (from www.asternic.org) to call up Compiere onto the PC so that we know who is calling and all the customers' relevant data is at our fingertips.
Naturally we interface with the web-based CRM module of Compiere. But not just yet. We will use the more familiar Mecca framework (from www.sf.net/projects/university) to be the opening callup screen and it drills into the DB tables particularly C_BPartner, Historical tables and R_Request tables that CRM mainly sits on.
Among the first tasks is to study Compiere's CRM Module. This workshop is to walk thru that and expose its inner workings especially when we encounter stuff we can't figure out.
This is a project brainchild of a private firm that controls the copyright and commercial ownership. Tutorials here are just workshop parts on related Compiere issues that are already Open Source.
BEGINNING OF PART I - MAKING A REQUEST
When Compiere is run from the web, it opens the following screen. http://compiere.red1.org/FirstScreen.htm . At the Self Service row, there is a Send Request link. Where u can see i have put in 2 requests. Now if u go into your favorite DB Editor or TOAD u look into the R_Request table u will find the requests u made.
But when i login into the Compiere webstart i do not find uch requests in the Requests panel at the bottom of the dialog box. Thus this becomes our first journey into debuging the issue and hopefully we learn alot from it.
PART II - DEBUGGING REQUEST PROMPT MYSTERY
Using Eclipse upon the source codes, click on the Search icon and search for R_Request among the *.java. U will hit 464 instances. And the very first java that has such a reference is AMenu.java which is exactly what we need to look into cos it must be the opening box that we are interested in. Upon peering inside sure enuf we see a telling clue in this snipper
- Code: Select all
/**
* Ger Number of open Requests
* @return number of requests
*/
private int getRequests()
{
int retValue = 0;
if (m_requestSQL == null)
m_requestSQL = MRole.getDefault().addAccessSQL ("SELECT COUNT(*) FROM R_Request "
+ "WHERE (SalesRep_ID=? OR AD_Role_ID=?) AND Processed='N'"
+ " AND (DateNextAction IS NULL OR TRUNC(DateNextAction) <= TRUNC(SysDate))"
+ " AND (R_Status_ID IS NULL OR R_Status_ID IN (SELECT R_Status_ID FROM R_Status WHERE IsClosed='N'))",
"R_Request", false, true); // not qualified - RW
try
{
PreparedStatement pstmt = DB.prepareStatement(m_requestSQL, null);
pstmt.setInt(1, m_AD_User_ID);
pstmt.setInt(2, m_AD_Role_ID);
- Code: Select all
SELECT * FROM R_Request WHERE (SalesRep_ID=? OR AD_Role_ID=?)
AND Processed='N' AND (DateNextAction IS NULL OR TRUNC(DateNextAction) <= TRUNC
(SysDate)) AND (R_Status_ID IS NULL OR R_Status_ID IN (SELECT R_Status_ID FROM R_Status
WHERE IsClosed='N')) AND AD_Client_ID=11 AND AD_Org_ID IN(0,11,12)
- Code: Select all
pstmt.setInt(1, m_AD_User_ID);
pstmt.setInt(2, m_AD_Role_ID);
First we trace who is SalesRep_ID = 100.
(to be cont'd)