my $details = InContact::cDBI::contact->contact_detail(recontact = > $tm);

This doesn't work because the contact_detail method created by has_many is an instance method - if you already had an object $obj of class InContact::cDBI::contact returned by retrieve or search then you could say

my @details = $obj->contact_detail(recontact = > $tm);

You can do something like

my @contacts = map { $_->contact_id } InContact::cDBI::contactdetail-> +search(recontact = > $tm);
and then filter out the duplicates.

But I think you will need to use set_sql to do the kind of search you have in mind (can't give an example because I don't know what your fields are).


In reply to Re: Class::DBI not giving me what I need! by Arunbear
in thread Class::DBI not giving me what I need! by jdtoronto

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.