<div dir="ltr"><div><div><div><div><div><div><div><div><div><div>Hello Adrian,<br><br></div>If you look at page 17 in vtlib documentation (mentioned as "step 5"), you need to add to your installation script the relation between your module and the others. See also the extensive explanation of joe bordes (link in my original mail hereunder). Concretely, you will add something like that:<br>
$module->setRelatedList(Vtiger_Module::getInstance('Accounts'), 'Payment
tracking',Array('ADD'),'get_dependents_list');<br><br></div>this create a relation of the new module with the one of the account. This instruction will create a record in the relatedlists table as already explained.<br>
<br></div>However, as joe bordes explained, when exporting the module it will not be able to have the relationship extracted because this is something at the account module level.<br><br></div>Assuming my new module is called PaymentML, go to PaymentML.php and add the relationship instruction $module->setRelatedList(Vtiger_Module::getInstance('Accounts'), 'Payment
tracking',Array('ADD'),'get_dependents_list');<br></div>to the function vtlib_handler:<br><br>    function vtlib_handler($modulename, $event_type) {<br>        if($event_type == 'module.postinstall') {<br>
            // TODO Handle post installation actions<br></div>            !!relation command goes here!!<br><br></div>This will create the relationship in the table immediately after the module is installed.<br><br></div>
I hope that clears up.<br><br></div>Regards,<br></div>Joel<br><div><div><div><div><div><div><br></div></div></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Nov 7, 2013 at 3:51 PM,  <span dir="ltr"><<a href="mailto:vtigercrm-developers-request@lists.vtigercrm.com" target="_blank">vtigercrm-developers-request@lists.vtigercrm.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send vtigercrm-developers mailing list submissions to<br>
        <a href="mailto:vtigercrm-developers@lists.vtigercrm.com">vtigercrm-developers@lists.vtigercrm.com</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="http://lists.vtigercrm.com/cgi-bin/mailman/listinfo/vtigercrm-developers" target="_blank">http://lists.vtigercrm.com/cgi-bin/mailman/listinfo/vtigercrm-developers</a><br>
<br>
or, via email, send a message with subject or body 'help' to<br>
        <a href="mailto:vtigercrm-developers-request@lists.vtigercrm.com">vtigercrm-developers-request@lists.vtigercrm.com</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:vtigercrm-developers-owner@lists.vtigercrm.com">vtigercrm-developers-owner@lists.vtigercrm.com</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of vtigercrm-developers digest..."<br>
<br>Today's Topics:<br>
<br>
   1. Re: Packaging newly created module (Support Team TheEasyRef)<br>
   2. Re: Packaging newly created module<br>
      (Adri?n Granado - Refineria Web)<br>
<br><br>---------- Forwarded message ----------<br>From: Support Team TheEasyRef <<a href="mailto:support@theeasyref.com">support@theeasyref.com</a>><br>To: <a href="mailto:vtigercrm-developers@lists.vtigercrm.com">vtigercrm-developers@lists.vtigercrm.com</a><br>
Cc: <br>Date: Thu, 7 Nov 2013 15:15:16 +0200<br>Subject: Re: [Vtigercrm-developers] Packaging newly created module<br><div dir="ltr"><div><div><div><div>Hello Joe,<br><br></div>Thanks for your tip with vtlib_handler(). That did the job.<br>
<br></div>I
 created this simple module mainly as a way to better understand the 
basics writing a custom module. It surely is not as extended as the one 
you developed.<br>
<br></div>Regards,<br></div>Joel<br><br>---------- Forwarded message ----------<br>To: <a href="mailto:vtigercrm-developers@lists.vtigercrm.com" target="_blank">vtigercrm-developers@lists.vtigercrm.com</a><br>
Cc: <br>Date: Wed, 06 Nov 2013 22:39:16 +0100<br>Subject: Re: [Vtigercrm-developers] Packaging newly created module<br>
  
    
  
  
    <div>Hi,<br>
      <br>
      The export process only registers information directly related
      with the module. The  related list you are adding is information
      on the other module, not yours.<br>
      To overcome this add your setRelatedList call in the
      vtlib_handler() method of your module's main class.<br>
      <br>
      May I ask why you didn't use our payment module?<br>
      <br>
      Joe<br>
      TSolucio<br>
      <br>
      <br>
      El 06/11/13 22:22, Support Team TheEasyRef escribió:<br>
    </div>
    
      <div dir="ltr"> Hello,<br>
        <br>
        I have written a small module than enables to track payments of
        accounts. Basically, it is a 1:m relationship with the account
        module, i.e. one account can have multiple payment tracking
        entities. The idea is that I can have my payment tracking module
        appear as a related list under the accounts (organisations),
        just like other modules as quotes, projects, products etc ...<br>
        <br>
        I used vtlib to create a script for the installation. For
        configuring the relationship I use the get_dependents_list
        function as mentioned by Joe Bordes at <a href="http://www.crmevolutivo.com/doku.php/es:vtlibrelated" rel="nofollow" target="_blank">http://www.crmevolutivo.com/doku.php/es:vtlibrelated</a><br>
        <br>
        concretely the code for this is :<br>
        $module->setRelatedList(Vtiger_Module::getInstance('Accounts'),
        'Payment tracking',Array('ADD'),'get_dependents_list');<br>
        <br>
        this will correctly update the vtiger_relatedlists table with an
        extra record.<br>
        <br>
        So the script works perfectly with no problem. However, when I
        want to export the new module, and install it on a new <span>vtiger</span>
        instance, I am loosing the relationship. This means that the
        payment tracking will not appear as a related list in the
        accounts. After checking, I found out that the import of the zip
        package will not update the vtiger_relatedlists table.<br>
        <br>
        Any idea why the export process is not working smoothly?<br>
        <br>
        Thanks,<br>
        Joel </div>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
<a href="http://www.vtiger.com/" target="_blank">http://www.<span>vtiger</span>.com/</a></pre></div>
<br><br>---------- Forwarded message ----------<br>From: "Adrián Granado - Refineria Web" <<a href="mailto:adrian@refineriaweb.com">adrian@refineriaweb.com</a>><br>To: <<a href="mailto:vtigercrm-developers@lists.vtigercrm.com">vtigercrm-developers@lists.vtigercrm.com</a>><br>
Cc: <br>Date: Thu, 7 Nov 2013 14:51:19 +0100<br>Subject: Re: [Vtigercrm-developers] Packaging newly created module<br>










<div link="blue" vlink="purple" lang="ES">

<div>

<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US">Can you explain more how you resolve the problem?<br>
<br>
Thanks!<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US"><u></u> <u></u></span></p>

<table style="width:225.0pt" border="0" cellpadding="0" cellspacing="0" width="300">
 <tbody><tr style="height:45.75pt">
  <td style="width:63.75pt;padding:0cm 0cm 3.75pt 0cm;height:45.75pt" width="85">
  <p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Arial","sans-serif";color:#1f497d"><img src="cid:image001.png@01CEDBC8.D12FDC80" alt="Refineria Web" height="61" width="61"></span><span style="font-size:10.5pt;font-family:"Arial","sans-serif";color:#1f497d"><u></u><u></u></span></p>

  </td>
  <td style="padding:0cm 0cm 3.75pt 0cm;height:45.75pt">
  <p class="MsoNormal" style="line-height:13.5pt"><b><span style="font-size:10.5pt;font-family:"Arial","sans-serif";color:#315047">Adrián Granado </span></b><span style="font-size:10.5pt;font-family:"Arial","sans-serif";color:#1f497d"><br>

  </span><span style="font-size:10.5pt;font-family:"Arial","sans-serif";color:#7ccee2">PROGRAMADOR </span><span style="font-size:10.5pt;font-family:"Arial","sans-serif";color:#1f497d"><br>

  <a href="mailto:%20adrian@refineriaweb.com" target="_blank"><span style="color:#315047;text-decoration:none">adrian@refineriaweb.com </span></a><u></u><u></u></span></p>
  </td>
 </tr>
</tbody></table>

<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>

<table style="width:187.5pt" border="0" cellpadding="0" cellspacing="0" width="250">
 <tbody><tr>
  <td style="width:14.25pt;padding:0cm 0cm 0cm 0cm" width="19"></td>
  <td style="border:none;border-right:solid white 1.0pt;background:#7ccee2;padding:5.25pt 0cm 5.25pt 7.5pt">
  <p class="MsoNormal" style="line-height:13.5pt"><span style="font-size:9.0pt;font-family:"Arial","sans-serif";color:white">C/ Gran Vía Asima, 20 - 2º
  Oficina 7<u></u><u></u></span></p>
  <p class="MsoNormal" style="line-height:13.5pt"><span style="font-size:9.0pt;font-family:"Arial","sans-serif";color:white">07009 Palma de Mallorca<br>
  Teléfono 971 72 98 83 – Ext. 511<br>
  Fax 971 780 391 <u></u><u></u></span></p>
  </td>
 </tr>
 <tr>
  <td colspan="2" style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal"><a href="http://www.refineriaweb.com/" target="_blank"><span style="font-size:9.0pt;font-family:"Arial","sans-serif";text-decoration:none"><img src="cid:image002.png@01CEDBC8.D12FDC80" alt="Refineria Web" height="30" border="0" width="268"></span></a><span style="font-size:9.0pt;font-family:"Arial","sans-serif";color:white"><u></u><u></u></span></p>

  </td>
 </tr>
</tbody></table>

<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>

<table style="width:5.0cm" border="0" cellpadding="0" cellspacing="0" width="189">
 <tbody><tr>
  <td style="width:102.75pt;padding:0cm 0cm 0cm 0cm" width="137"></td>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-top:2.25pt"><a href="https://www.facebook.com/refineriaweb1" target="_blank"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";text-decoration:none"><img src="cid:image003.png@01CEDBC8.D12FDC80" alt="Siguenos en Facebook" height="21" border="0" width="21"></span></a><a href="https://twitter.com/refineriaweb" target="_blank"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";text-decoration:none"><img src="cid:image004.png@01CEDBC8.D12FDC80" alt="Siguenos en Twitter" height="21" border="0" width="21"></span></a><span style="font-family:"Calibri","sans-serif";color:#1f497d"><u></u><u></u></span></p>

  </td>
 </tr>
</tbody></table>

<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>

<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm">

<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">De:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">
<a href="mailto:vtigercrm-developers-bounces@lists.vtigercrm.com" target="_blank">vtigercrm-developers-bounces@lists.vtigercrm.com</a>
[mailto:<a href="mailto:vtigercrm-developers-bounces@lists.vtigercrm.com" target="_blank">vtigercrm-developers-bounces@lists.vtigercrm.com</a>] <b>En nombre de </b>Support
Team TheEasyRef<br>
<b>Enviado el:</b> jueves, 07 de noviembre de 2013 14:15<br>
<b>Para:</b> <a href="mailto:vtigercrm-developers@lists.vtigercrm.com" target="_blank">vtigercrm-developers@lists.vtigercrm.com</a><br>
<b>Asunto:</b> Re: [Vtigercrm-developers] Packaging newly created module<u></u><u></u></span></p>

</div>

<p class="MsoNormal"><u></u> <u></u></p>

<div>

<div>

<div>

<div>

<div>

<p class="MsoNormal" style="margin-bottom:12.0pt">Hello Joe,<u></u><u></u></p>

</div>

<p class="MsoNormal" style="margin-bottom:12.0pt">Thanks for your tip with
vtlib_handler(). That did the job.<u></u><u></u></p>

</div>

<p class="MsoNormal" style="margin-bottom:12.0pt">I created this simple module
mainly as a way to better understand the basics writing a custom module. It
surely is not as extended as the one you developed.<u></u><u></u></p>

</div>

<p class="MsoNormal">Regards,<u></u><u></u></p>

</div>

<p class="MsoNormal">Joel<br>
<br>
---------- Forwarded message ----------<br>
To: <a href="mailto:vtigercrm-developers@lists.vtigercrm.com" target="_blank">vtigercrm-developers@lists.vtigercrm.com</a><br>
Cc: <br>
Date: Wed, 06 Nov 2013 22:39:16 +0100<br>
Subject: Re: [Vtigercrm-developers] Packaging newly created module<u></u><u></u></p>

<div>

<p class="MsoNormal">Hi,<br>
<br>
The export process only registers information directly related with the module.
The  related list you are adding is information on the other module, not
yours.<br>
To overcome this add your setRelatedList call in the vtlib_handler() method of
your module's main class.<br>
<br>
May I ask why you didn't use our payment module?<br>
<br>
Joe<br>
TSolucio<br>
<br>
<br>
El 06/11/13 22:22, Support Team TheEasyRef escribió:<u></u><u></u></p>

</div>

<div>

<p class="MsoNormal">Hello,<br>
<br>
I have written a small module than enables to track payments of accounts.
Basically, it is a 1:m relationship with the account module, i.e. one account
can have multiple payment tracking entities. The idea is that I can have my
payment tracking module appear as a related list under the accounts
(organisations), just like other modules as quotes, projects, products etc ...<br>
<br>
I used vtlib to create a script for the installation. For configuring the
relationship I use the get_dependents_list function as mentioned by Joe Bordes
at <a href="http://www.crmevolutivo.com/doku.php/es:vtlibrelated" target="_blank">http://www.crmevolutivo.com/doku.php/es:vtlibrelated</a><br>
<br>
concretely the code for this is :<br>
$module->setRelatedList(Vtiger_Module::getInstance('Accounts'), 'Payment
tracking',Array('ADD'),'get_dependents_list');<br>
<br>
this will correctly update the vtiger_relatedlists table with an extra record.<br>
<br>
So the script works perfectly with no problem. However, when I want to export
the new module, and install it on a new vtiger instance, I am loosing the
relationship. This means that the payment tracking will not appear as a related
list in the accounts. After checking, I found out that the import of the zip
package will not update the vtiger_relatedlists table.<br>
<br>
Any idea why the export process is not working smoothly?<br>
<br>
Thanks,<br>
Joel <u></u><u></u></p>

</div>

<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p>

<pre>_______________________________________________<u></u><u></u></pre><pre><a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a><u></u><u></u></pre></div>

</div>

</div>


<br>_______________________________________________<br>
vtigercrm-developers mailing list<br>
<a href="mailto:vtigercrm-developers@lists.vtigercrm.com">vtigercrm-developers@lists.vtigercrm.com</a><br>
<a href="http://lists.vtigercrm.com/cgi-bin/mailman/listinfo/vtigercrm-developers" target="_blank">http://lists.vtigercrm.com/cgi-bin/mailman/listinfo/vtigercrm-developers</a><br>
<br></blockquote></div><br></div></div>