Results 1 to 2 of 2

Thread: Relate Documents to Accounts & attach Documents to Emails filtering on Accounts

  1. #1
    john.phortse is offline Member
    Join Date
    Sep 2009
    Posts
    9

    Default Relate Documents to Accounts & attach Documents to Emails filtering on Accounts

    I want to relate multiple documents from the Document Module to an Account and then be able to attach these Documents from the Email Module filtering on Accounts.

    In Studio, I created a custom field in the document module - account_c (LBL_ACCOUNT) and added it to my EditView, DetailedView, ListView and Basic Search. I then created a relationship in the Accounts Module creating a many-to-many relationship Accounts to Documents. EditView, DetailedView, ListView and Basic Search work fine.

    I’m stuck on the modification required to make PopupDocuments.php and PopupDocuments.html to work so I can attach Document from Sugar Documents and filter on Accounts.
    In /modules/Emails/PopupDocuments.php I added:
    PHP Code:
    $account_c = empty($_REQUEST['account_c']) ? '' $_REQUEST['account_c']; 
    PHP Code:
    $form->assign("ACCOUNT_C"get_select_options_with_id($app_list_strings['account_c'], $account_c)); 
    In /modules/Emails/PopupDocuments.php I added the account_c dataLabel to filter on and it shows up; however, when I attempted to filter on the account_c field nothing shows up.
    HTML Code:
    <td class="dataLabel" nowrap="nowrap">{MOD.LBL_ACCOUNT}</td>
    <td class="dataField" nowrap="nowrap"><input type="text" name="account_c" class="dataField" size="30" value="{ACCOUNT_C}"</td>
    I added this line to add the Account_C column to the list; however, the account_c column is not showing up on the list.
    HTML Code:
    <td valign="top" class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}">{DOCUMENT.ACCOUNT_C}</td>
    I noticed that when I created the account_c custom field, Studio added it to a new table: documents_cstm.

    Any assistance on this issue would be greatly appreciated.

    John

    SugarCRM version 5.2.0i
    Apache version 2.2.11 (Unix)
    PHP version 5.2.9
    MySQL version 5.0.77-community
    Operating system Linux
    Last edited by john.phortse; 2009-09-18 at 07:36 PM.

  2. #2
    john.phortse is offline Member
    Join Date
    Sep 2009
    Posts
    9

    Default Re: Relate Documents to Accounts & attach Documents to Emails filtering on Accounts

    It appears my issue related to /modules/documents/Popup_picker.php.

    /modules/emails/PopupDocuments.php on line 45 has require_once('modules/Documents/Popup_picker.php').

    Popup_picker.php has the default $where = ''; to generate the listview.

    PHP Code:
        function _get_where_clause()
        {
            
    $where '';
            if(isset(
    $_REQUEST['query']))
            {
                
    $where_clauses = array();
                
    append_where_clause($where_clauses"document_id""documents.id");
                
    append_where_clause($where_clauses"document_name""documents.document_name");
                
    append_where_clause($where_clauses"category_id""documents.category_id");
                
    append_where_clause($where_clauses"subcategory_id""documents.subcategory_id");
                
    append_where_clause($where_clauses"template_type""documents.template_type");
                
    append_where_clause($where_clauses"is_template""documents.is_template");

            
                
    $where generate_where_statement($where_clauses);
            }
            return 
    $where;
        } 
    I guess my question is how to a update the $where = ''; so I can populate the listview with the account.name?

    Thanks for the help and support.

    John

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Attach Documents to Accounts
    By ruPPa in forum General Discussion
    Replies: 1
    Last Post: 2009-02-06, 07:09 AM
  2. Replies: 5
    Last Post: 2009-02-05, 07:36 PM
  3. Show documents under ACCOUNTS
    By dpresbit in forum Help
    Replies: 1
    Last Post: 2008-07-30, 02:31 AM
  4. Replies: 1
    Last Post: 2007-12-10, 10:25 PM
  5. Documents associated to Accounts
    By c24 in forum Help
    Replies: 3
    Last Post: 2007-05-28, 01:44 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •