[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vtigercrm-developers
Subject:    Re: [Vtigercrm-developers] Relate two custom modules
From:       Nicolas Larcipretti <niclarcipretti () gmail ! com>
Date:       2011-09-12 13:44:01
Message-ID: CAK10WeDOBSKvm9Kt92oqSsx5CPgL70Xxkf-g41AeLMih-G-K4Q () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi Conrado,

Welcome!

If I were you, I'd take a better look at the Bank.php file. Does it's first
lines looks like this? (Territory is the module's name)

class Territory extends CRMEntity {
    var $db, $log; // Used in class functions of CRMEntity

    var $table_name = 'vtiger_territory';
    var $table_index= 'territoryid';
    var $column_fields = Array();

    /** Indicator if this is a custom module or standard module */
    var $IsCustomModule = true;

    /**
     * Mandatory table for supporting custom fields.
     */
    var $customFieldTable = Array('vtiger_territorycf', 'territoryid');

    /**
     * Mandatory for Saving, Include tables related to this module.
     */
    var $tab_name = Array('vtiger_crmentity', 'vtiger_territory',
'vtiger_territorycf');

    /**
     * Mandatory for Saving, Include tablename and tablekey columnname here.
     */
    var $tab_name_index = Array(
        'vtiger_crmentity' => 'crmid',
        'vtiger_territory' => 'territoryid',
        'vtiger_territorycf' => 'territoryid',
        );

    /**
     * Mandatory for Listing (Related listview)
     */
    var $list_fields = Array (
        /* Format: Field Label => Array(tablename, columnname) */
        // tablename should not have prefix 'vtiger_'
        'LBL_NM_TERRITORIO'=> Array('territory', 'nm_territorio'),
        'LBL_NM_TERRITORIO_PAI'=> Array('territory', 'cd_territorio_pai')
    );
    var $list_fields_name = Array(
        /* Format: Field Label => fieldname */
        'LBL_NM_TERRITORIO'=> 'nm_territorio',
        'LBL_NM_TERRITORIO_PAI' => 'cd_territorio_pai'
    );

    // Make the field link to detail view from list view (Fieldname)
    var $list_link_field = 'nm_territorio';

    // For Popup listview and UI type support
    var $search_fields = Array(
        /* Format: Field Label => Array(tablename, columnname) */
        // tablename should not have prefix 'vtiger_'
        'LBL_NM_TERRITORIO'=> Array('territory', 'nm_territorio'),
        'LBL_NM_TERRITORIO_PAI'=> Array('territory', 'cd_territorio_pai'),
        'LBL_NM_TIPO_TERRITORIO'=> Array('territory', 'nm_tipo_territorio'),
        'Assigned To'=> Array('crmentity', 'smownerid')
    );
    var $search_fields_name = Array(
        /* Format: Field Label => fieldname */
        'LBL_NM_TERRITORIO'=> 'nm_territorio',
        'LBL_NM_TERRITORIO_PAI'=> 'cd_territorio_pai',
        'LBL_NM_TIPO_TERRITORIO'=> 'nm_tipo_territorio',
        'Assigned To'=> 'assigned_user_id'
    );

    // For Popup window record selection
    var $popup_fields = Array('nm_territorio');

    // Placeholder for sort fields - All the fields will be initialized for
Sorting through initSortFields
    var $sortby_fields = Array();

    // For Alphabetical search
    var $def_basicsearch_col = 'nm_territorio';

    // Column value to use on detail view record text display
    var $def_detailview_recname = 'nm_territorio';

    // Required Information for enabling Import feature
    var $required_fields = Array('nm_territorio'=>1);

    // Callback function list during Importing
    var $special_functions = Array('set_import_assigned_user');

    var $default_order_by = 'cd_territorio';
    var $default_sort_order='ASC';
    // Used when enabling/disabling the mandatory fields for the module.
    // Refers to vtiger_field.fieldname values.
    var $mandatory_fields = Array('createdtime', 'modifiedtime',
'nm_territorio');

Cheers

Nicolas.



2011/9/12 Conrado Maggi <comaggi@gmail.com>

> **
> Hi,
>
> This is my first message to the list. Here Conrado form Argentina.
>
> I have created a couple of modules using vtlib. One of them includes two
> fields related to other modules (uitype = 10):
>
> The field that is related to accounts, contacts, vendors I have no problems
> and  In this case the popup works smoothly.
>
> But I created a second  field related to a custom module called "Banks"
> when I open the popup is completely blank. Reading the forum I found a
> similar problem so I incorporated the variable $ var popup_fields = Array
> ('bancosname'); in bancos.php yet still the displayed popup is blank
>
> I would really appreciate your help to make this works
>
> Thanks a lot!
>
> Conrado
>
> _______________________________________________
> http://www.vtiger.com/
>

[Attachment #5 (text/html)]

Hi Conrado,<br><br>Welcome!<br><br>If I were you, I&#39;d take a better look at the \
Bank.php file. Does it&#39;s first lines looks like this? (Territory is the \
module&#39;s name)<br><br>class Territory extends CRMEntity {<br>  var $db, $log; // \
Used in class functions of CRMEntity<br><br>    var $table_name = \
&#39;vtiger_territory&#39;;<br>    var $table_index= &#39;territoryid&#39;;<br>    \
var $column_fields = Array();<br><br>    /** Indicator if this is a custom module or \
standard module */<br>  var $IsCustomModule = true;<br><br>    /**<br>     * \
Mandatory table for supporting custom fields.<br>     */<br>    var $customFieldTable \
                = Array(&#39;vtiger_territorycf&#39;, &#39;territoryid&#39;);<br><br> \
                /**<br>
     * Mandatory for Saving, Include tables related to this module.<br>     */<br>    \
var $tab_name = Array(&#39;vtiger_crmentity&#39;, &#39;vtiger_territory&#39;, \
&#39;vtiger_territorycf&#39;);<br><br>    /**<br>     * Mandatory for Saving, Include \
                tablename and tablekey columnname here.<br>
     */<br>    var $tab_name_index = Array(<br>        &#39;vtiger_crmentity&#39; \
=&gt; &#39;crmid&#39;,<br>        &#39;vtiger_territory&#39; =&gt; \
&#39;territoryid&#39;,<br>        &#39;vtiger_territorycf&#39; =&gt; \
&#39;territoryid&#39;,<br>  );<br><br>    /**<br>     * Mandatory for Listing \
(Related listview)<br>     */<br>    var $list_fields = Array (<br>        /* Format: \
Field Label =&gt; Array(tablename, columnname) */<br>        // tablename should not \
have prefix &#39;vtiger_&#39;<br>  &#39;LBL_NM_TERRITORIO&#39;=&gt; \
Array(&#39;territory&#39;, &#39;nm_territorio&#39;),<br>        \
&#39;LBL_NM_TERRITORIO_PAI&#39;=&gt; Array(&#39;territory&#39;, \
&#39;cd_territorio_pai&#39;)<br>    );<br>    var $list_fields_name = Array(<br>  /* \
Format: Field Label =&gt; fieldname */<br>        &#39;LBL_NM_TERRITORIO&#39;=&gt; \
&#39;nm_territorio&#39;,<br>        &#39;LBL_NM_TERRITORIO_PAI&#39; =&gt; \
&#39;cd_territorio_pai&#39;<br>    );<br><br>    // Make the field link to detail \
view from list view (Fieldname)<br>  var $list_link_field = \
&#39;nm_territorio&#39;;<br><br>    // For Popup listview and UI type support<br>    \
var $search_fields = Array(<br>        /* Format: Field Label =&gt; Array(tablename, \
columnname) */<br>        // tablename should not have prefix &#39;vtiger_&#39;<br>  \
&#39;LBL_NM_TERRITORIO&#39;=&gt; Array(&#39;territory&#39;, \
&#39;nm_territorio&#39;),<br>        &#39;LBL_NM_TERRITORIO_PAI&#39;=&gt; \
Array(&#39;territory&#39;, &#39;cd_territorio_pai&#39;),<br>        \
&#39;LBL_NM_TIPO_TERRITORIO&#39;=&gt; Array(&#39;territory&#39;, \
&#39;nm_tipo_territorio&#39;),<br>  &#39;Assigned To&#39;=&gt; \
Array(&#39;crmentity&#39;, &#39;smownerid&#39;)<br>    );<br>    var \
$search_fields_name = Array(<br>        /* Format: Field Label =&gt; fieldname */<br> \
&#39;LBL_NM_TERRITORIO&#39;=&gt; &#39;nm_territorio&#39;,<br>  \
&#39;LBL_NM_TERRITORIO_PAI&#39;=&gt; &#39;cd_territorio_pai&#39;,<br>        \
&#39;LBL_NM_TIPO_TERRITORIO&#39;=&gt; &#39;nm_tipo_territorio&#39;,<br>        \
&#39;Assigned To&#39;=&gt; &#39;assigned_user_id&#39;<br>  );<br><br>    // For Popup \
window record selection<br>    var $popup_fields = \
Array(&#39;nm_territorio&#39;);<br><br>    // Placeholder for sort fields - All the \
fields will be initialized for Sorting through initSortFields<br>  var $sortby_fields \
= Array();<br><br>    // For Alphabetical search<br>    var $def_basicsearch_col = \
&#39;nm_territorio&#39;;<br><br>    // Column value to use on detail view record text \
display<br>    var $def_detailview_recname = &#39;nm_territorio&#39;;<br> <br>    // \
Required Information for enabling Import feature<br>    var $required_fields = \
Array(&#39;nm_territorio&#39;=&gt;1);<br><br>    // Callback function list during \
Importing<br>    var $special_functions = \
Array(&#39;set_import_assigned_user&#39;);<br> <br>    var $default_order_by = \
&#39;cd_territorio&#39;;<br>    var $default_sort_order=&#39;ASC&#39;;<br>    // Used \
when enabling/disabling the mandatory fields for the module.<br>    // Refers to \
vtiger_field.fieldname values.<br>  var $mandatory_fields = \
Array(&#39;createdtime&#39;, &#39;modifiedtime&#39;, \
&#39;nm_territorio&#39;);<br><br>Cheers<br><br>Nicolas.<br><br><br><br><div \
class="gmail_quote">2011/9/12 Conrado Maggi <span dir="ltr">&lt;<a \
href="mailto:comaggi@gmail.com">comaggi@gmail.com</a>&gt;</span><br> <blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex;"><u></u>


  
  

<div>
Hi,<br>
<br>
This is my first message to the list. Here Conrado form Argentina.<br>
<br>
I have created a couple of modules using vtlib. One of them includes two fields \
related to other modules (uitype = 10):<br> <br>
The field that is related to accounts, contacts, vendors I have no problems and  In \
this case the popup works smoothly.<br> <br>
But I created a second  field related to a custom module called &quot;Banks&quot; \
when I open the popup is completely blank. Reading the forum I found a similar \
problem so I incorporated the variable $ var popup_fields = Array \
(&#39;bancosname&#39;); in bancos.php yet still the displayed popup is blank<br>

<br>
I would really appreciate your help to make this works<br>
<br>
Thanks a lot!<br><font color="#888888">
<br>
Conrado
<br>
</font></div>

<br>_______________________________________________<br>
<a href="http://www.vtiger.com/" \
target="_blank">http://www.vtiger.com/</a><br></blockquote></div><br>



_______________________________________________
http://www.vtiger.com/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic