Stonefield Query
 
Stonefield Site Map
Stonefield Support

  Overview
  Submit Support Ticket
  Forums
  Online Help Files
  Services
  Pre-Sales Support
Online Webinars
Video Demonstrations
Feature Requests
  Software Maintenance
  Support Testimonials
  FAQ's
Quick Links
Buy Now!
Download Free Trial
Watch a Video
Contact Us

 
 You are here: Support * Support Forums   Search

 Stonefield Query Support Forum

Welcome to the Stonefield Query Support Forum. Please note that in order to participate in the support forums, registration at our site is required. If you are already a member of our site, please sign-in.

 

Subject: Link 2nd contact to detail

You are not authorized to post a reply.   

Author Messages
denisv
Posts:56

01/30/2008 4:23 AM Alert 

Hi,

I want to create a report that links a secondary contact to specific details.

I can create a report that groups by 2nd contact and inculdes all details of a specific type, but what I wanted to try was link some details (of a defined type) to 2nd contact by maybe using Reference in 2nd Contact value = Reference in the Detail.

So if I have a detail type of 'SAMPLE' and a reference value of 'ABC', if I had a 2nd contact of  'DV' with it's Reference value of 'ABC', and also had other details of type 'SAMPLE' but without the reference value of 'ABC' then the report would only show one detail entry for that 2nd contact.

Is this possible ?

Thanks

tmansuy
Posts:161

01/30/2008 10:36 AM Alert 

Hi,

You should be able to do something like this by modifying the join to include that additional condition you describe. So, if the join is something like:

TABLE1 inner join TABLE2 on TABLE1.ID = TABLE2.ID

You could modify it to be something like:

TABLE1 inner join TABLE2 on TABLE1.ID = TABLE2.ID and TABLE1.REF = TABLE2.REF

Please keep in mind that Goldmine sometimes has the tendency to stuff extra information in fields that it doesn't display in the GoldMine client. For example, I believe it puts a Contact name in the reference field of a history record, even though you can't see it in Goldmine itself. You may need to lookup the fields you are trying to join on with a tool like SQL server management studio, to verify what exactly is stored there.

Trevor

denisv
Posts:56

05/01/2008 10:59 AM Alert 
Hi, I am continuing to work on this and at least I've reaced the satge where I am not getting errors. However I am also not getting data which is another check I will do. When I run the report I get no matching records (which I will check) but also when I agree that I get a Stonefield Titled window stating that

'The custom code for OnSelect is invalid. The error message is: contact1.dbf soes not exist'.

SQL is (Where XXINVESTMENT is a detail type):

select XXINVESTMENT.CONTACT,CONTACTS.CONTACT as CONTACT_A,CONTACTS.TITLE,XXINVESTMENT.ADDRESS2, XXINVESTMENT.ADDRESS3 from CONTSUPP XXINVESTMENT inner join CONTACT1 on XXINVESTMENT.ACCOUNTNO=CONTACT1.ACCOUNTNO inner join CONTSUPP CONTACTS on CONTACTS.ACCOUNTNO=CONTACT1.ACCOUNTNO where CONTACTS.RECTYPE = 'C' and XXINVESTMENT.RECTYPE = 'P' and XXINVESTMENT.CONTACT = 'Investment' and CONTACTS.TITLE = XXINVESTMENT.ADDRESS3
denisv
Posts:56

05/01/2008 11:14 AM Alert 
I have now got this showing data (wrong link my side). Onviously I have had to add all fields from report into the OnSelect SQL code and also use aliases where necessary but it does return data. However, wnei I have previewed the report and c;osed it and then select FINISH on the wizard I then get the CONTACT1.dbf error.

Perhaps this is because my joins quote the CONTACT1 but I have no field from it. I actually want to add KEY3 to the select but then I get an unrecognized key word or phrase.

Working SQL: (If I add CONTACT1.KEY3, after the select it fails)

select XXINVESTMENT.CONTACT,CONTACTS.CONTACT as CONTACT_A,CONTACTS.TITLE AS TITLE_A, CONTACTS.ADDRESS1 as ADDRESS1_A, CONTACTS.ADDRESS2 as ADDRESS2_A, CONTACTS.ADDRESS3 as ADDRESS3_A, XXINVESTMENT.ADDRESS2, XXINVESTMENT.ADDRESS3, XXINVESTMENT.ADDRESS1, XXINVESTMENT.CONTSUPREF, XXINVESTMENT.STATE, XXINVESTMENT.TITLE from CONTSUPP XXINVESTMENT inner join CONTACT1 on XXINVESTMENT.ACCOUNTNO=CONTACT1.ACCOUNTNO inner join CONTSUPP CONTACTS on CONTACTS.ACCOUNTNO=CONTACT1.ACCOUNTNO where CONTACTS.RECTYPE = 'C' and XXINVESTMENT.RECTYPE = 'P' and XXINVESTMENT.CONTACT = 'Investment' and CONTACT_A = XXINVESTMENT.ADDRESS2
Chris Wolf
Posts:217

05/01/2008 12:08 PM Alert 
We will need to see the report itself in order to diagnose the issue.

Please export the report to an SFX file and email it to support@stonefieldquery.com

- Chris Wolf
Stonefield Software Inc.
dhennig
Posts:100

05/01/2008 12:18 PM Alert 
Hi Denis.

OnSelect isn't the correct place to put that code. That code is executed whenever you simply select the report in the Reports Explorer. You likely want to out that into the SQL statement for the report instead.

Doug
denisv
Posts:56

05/01/2008 12:43 PM Alert 
I think the solution lies in that. I didn't have the code in the OnSelect I had it in the Custom SQL. However when you replied I checked and there was code in the OnSelect as well. I deleted that code and now the Contact1 error is gone.

I have still the problem where I want to add KEY3 into the report. If I add iit to the select statement it gives the error. I assume I need to include some sort of second select clause within this ?
dhennig
Posts:100

05/01/2008 12:58 PM Alert 
Hi Denis.

As Chris mentioned, please send us the report so we can check it out. Thanks.

Doug
You are not authorized to post a reply.



ActiveForums 3.6

 
 
   Privacy Statement  |  Terms Of Use
© 1996-2008 Stonefield Software Inc. All rights reserved.