Master
| Related Entries linkages are stored in the Opportunity_Link table, Type=14. |
| | |
Member

| quote: =14
So I set the Type id in that table to 14 and then choose description, how do I get to the related entries defined. |
| | | Posts: 38 | Location: USA | Registered: September 23, 2004 |  
IP
|
|
Master
| There is no "Related Entries" table. As I said, the relations are stored in the Opportunity Link table. In ME9 eCRM SQL that table is called 'AMGR_Opportunity_Link'.
The rows corresponding to Related Entries linkages are the ones with a value of 14 in the 'Type' column. The 'Opp_Id' and 'Opp_Number' columns identify the Primary address book Entry, and the 'Client_Id' and 'Contact_Number' columns identify its Related Entry. |
| | |
Member

| quote: Reply
Hey thanks man, this is valuable information. Now I have to figure out how to convert the opp_id to a compnay name and client_id to a company name. have you done this before do you have an easy way. |
| | | Posts: 38 | Location: USA | Registered: September 23, 2004 |  
IP
|
|
Master
| In both cases you need a join to AMGR_Client, so you have to include that view (or table) in your report twice. In ME9 SQL, the query that Crystal Reports would use would be something like this: SELECT "AMGR_Client"."Name", "AMGR_Client"."First_Name",
"AMGR_Client_1"."Name", "AMGR_Client_1"."First_Name",
"AMGR_Opportunity_Link"."Type"
FROM
(
"AMGR_Client" "AMGR_Client"
INNER JOIN "AMGR_Opportunity_Link" "AMGR_Opportunity_Link"
ON ("AMGR_Client"."Client_Id"="AMGR_Opportunity_Link"."Opp_Id")
AND ("AMGR_Client"."Contact_Number"="AMGR_Opportunity_Link"."Opp_Number")
)
INNER JOIN "AMGR_Client" "AMGR_Client_1"
ON ("AMGR_Opportunity_Link"."Client_Id"="AMGR_Client_1"."Client_Id")
AND ("AMGR_Opportunity_Link"."Contact_Number"="AMGR_Client_1"."Contact_Number")
WHERE "AMGR_Opportunity_Link"."Type"=14
|
| | |