Hi Roy,<div><br></div><div>Please note that I did not read your post thoroughly or truly consider your question.</div><div><br></div><div>I&#39;m just writing to let you know that Views &quot;Preview&quot; functionality is a bit funky, it doesn&#39;t work reliably in all situations. I don&#39;t rely on Views Preview for anything. Do you really need it?</div>
<div><br></div><div>Shai<br><br><div class="gmail_quote">On Mon, Feb 15, 2010 at 7:14 PM, Roy R <span dir="ltr">&lt;<a href="mailto:roy.redirect@gmail.com">roy.redirect@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hello Drupal gurus,<br>
Newbie drupal user trying to set up a website for a non-profit org.<br>
<br>
I am using Content Profile to capture a Member Account Number field in<br>
a CCK text field.<br>
I have a Content Type for Contributions which basically lists each<br>
contribution received, it has CCK fields for amount, check#, date, and<br>
Member Account Number (shared field with Content Profile)<br>
<br>
I want to add a menu option called &quot;My Contributions&quot; that will<br>
display a table listing the contributions for the current user for a<br>
given year (exposed filter on year) i.e. I need to get the Member<br>
Number field, and use that to filter the Contributions nodes.<br>
<br>
Reading various posts online I understood the best way to do this was<br>
to use Views to retrieve the Member Account Number from Content<br>
Profile and use that to create a default argument for another<br>
Contributions table View. So I have a view called<br>
&quot;user_profile_select&quot; that basically retrieves the user profile for<br>
the current user. (1 record only), and a second view that takes two<br>
parameters, a date, and a Member Number. The following code is added<br>
to the default argument section of the Contributions table view.<br>
<br>
$view = views_get_view(&#39;user_profile_select&#39;);<br>
$view-&gt;execute();<br>
if ( count($view-&gt;result) ) {<br>
  $ret =<br>
    $view-&gt;result[0]-&gt;node_users_node_data_field_membernumber_field_membernumber_value;<br>
  return $ret;<br>
}<br>
else {<br>
  return false;<br>
}<br>
<br>
This kind of works, I can see that the correct Member number is being<br>
retrieved from the first view, and the second view&#39;s SQLs WHERE clause<br>
shows the correct argument. But the View does not display any records<br>
in Preview mode. If I pass in the same parameters manually, via the<br>
Preview text box, it works.<br>
<br>
What could be going wrong?? Thanks in advance for your help.<br>
<br>
Also please let me know if there are any easier alternatives to doing<br>
this? I tried playing with Panels and Contexts. My thought was I<br>
should be able to put the first view (user_profile_select) in a Panel,<br>
and add the second view to the same panel and have the second view<br>
pull its arguments from the first view&#39;s context. But this apparently<br>
does not work, I cannot see any CCK fields in the context.  I thought<br>
this kind of simple header/detail displays might be supported out of<br>
the box.<br>
<br>
Regards<br>
Roy<br>
<font color="#888888">--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br>
</font></blockquote></div><br></div>