<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Hello,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Can you please provide some instructions on how to delete a relation froma custom module. I know how to add relations from other modules but I don’t know how to remove them
 if I don’t need them, and I don’t want to erase the whole module.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">I tried to use the unset function like this:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New"">$moduleInstance->unsetRelatedList($accountsModule, $relationLabel, Array('ADD','SELECT'));<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">I get the following output: “</span><span style="font-size:13.5pt;color:black">Unsetting relation with Accounts ... DONE”
</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:black">but nothing happens in my module.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:black">Thank you!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Calibri","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">----<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-size:14.0pt;font-family:"Calibri","sans-serif"">Mihai Oprea</span></b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><br>
<b><i><span style="color:#920000">IT Specialist</span></i></b><o:p></o:p></span></p>
<p class="MsoNormal"><u><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><a href="mailto:mihai.oprea@sphs.ro">mihai.oprea@sphs.ro</a></span></u><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">
<a href="mailto:vtigercrm-developers-bounces@lists.vtigercrm.com">vtigercrm-developers-bounces@lists.vtigercrm.com</a> [<a href="mailto:vtigercrm-developers-bounces@lists.vtigercrm.com">mailto:vtigercrm-developers-bounces@lists.vtigercrm.com</a>]
<b>On Behalf Of </b>Juan Pablo Botero<br>
<b>Sent:</b> 22 martie 2013 15:59<br>
<b>To:</b> <a href="mailto:vtigercrm-developers@lists.vtigercrm.com">vtigercrm-developers@lists.vtigercrm.com</a><br>
<b>Subject:</b> Re: [Vtigercrm-developers] Relationship between Projects and Accounts<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">That works pretty cool.<o:p></o:p></p>
</div>
<p class="MsoNormal">Thanks for your help<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<div>
<p class="MsoNormal">2013/3/21 Juan Pablo Botero <<a href="mailto:juanpabloboterolopez@gmail.com" target="_blank">juanpabloboterolopez@gmail.com</a>><o:p></o:p></p>
<div>
<div>
<p class="MsoNormal">Thanks Richard and Alan.<br>
<br>
We think that is the way to add the relationship, gonna apply and tell the results.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<div>
<p class="MsoNormal">2013/3/20 Alan Lord (News) <<a href="mailto:alanslists@gmail.com" target="_blank">alanslists@gmail.com</a>><o:p></o:p></p>
<div>
<div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On 20/03/13 04:31, Juan Pablo Botero wrote:<o:p></o:p></p>
<p class="MsoNormal">Richards, thanks for answer.; i think that is the way.<br>
But it seems to work with a new modules, the modules that already exist,<br>
what file can i edit?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">You just need to create your vtlib script in the same way as you do for a new module.<br>
<br>
As an example here would be a vtlib script to add a new field to the Accounts module (the nice thing doing it this way is it means no cf_xxx fields and tables - and you can do anything the vtlib API supports):<o:p></o:p></p>
<p class="MsoNormal"><?php<br>
// Turn on debugging level<br>
$Vtiger_Utils_Log = true;<br>
include_once('vtlib/Vtiger/Menu.php');<br>
include_once('vtlib/Vtiger/Module.php');<br>
include_once('F1k_Extensions/libs.php');<br>
<br>
// Get a handle to the accounts module<br>
$module = Vtiger_Module::getInstance('Accounts');<br>
<br>
// Get our custom block<br>
<br>
$block_custom = Vtiger_Block::getInstance('Custom Information', $module);<br>
<br>
// Add the field to hold IP Addresses<br>
<br>
// Remove if already exiting<br>
$field_ipadds = Vtiger_Field::getInstance('ipadds', $module);<br>
<br>
if ($field_ipadds != false) {<br>
<br>
        $field_ipadds->delete();<br>
<br>
}<br>
<br>
$field_ipadds = new Vtiger_Field();<br>
<br>
$field_ipadds->name = 'ipadds';<br>
<br>
$field_ipadds->label= 'IP Addresses';<br>
<br>
$field_ipadds->column = 'ipadds';<br>
<br>
$field_ipadds->columntype = 'TEXT';<br>
<br>
$field_ipadds->uitype = 21;<br>
<br>
$field_ipadds->typeofdata = 'V~O';<br>
<br>
$block_custom->addField($field_ipadds);<br>
<br>
?><o:p></o:p></p>
<p class="MsoNormal"><br>
HTH<span style="color:#888888"><br>
<br>
Al<br>
<br>
-- <br>
Libertus Solutions<br>
<a href="http://www.libertus.co.uk" target="_blank">http://www.libertus.co.uk</a><br>
<br>
_______________________________________________<br>
<a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a></span><o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
<p class="MsoNormal"><br>
<br clear="all">
<o:p></o:p></p>
<div>
<p class="MsoNormal"><br>
-- <br>
Cordialmente:<br>
Juan Pablo Botero<br>
Administrador de Sistemas informáticos<br>
Fedora Ambassador for Colombia<o:p></o:p></p>
<div>
<p class="MsoNormal"><a href="http://www.jpilldev.net" target="_blank">http://www.jpilldev.net</a><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><br>
<br clear="all">
<br>
-- <br>
Cordialmente:<br>
Juan Pablo Botero<br>
Administrador de Sistemas informáticos<br>
Fedora Ambassador for Colombia<o:p></o:p></p>
<div>
<p class="MsoNormal"><a href="http://www.jpilldev.net" target="_blank">http://www.jpilldev.net</a><o:p></o:p></p>
</div>
</div>
</div>
</body>
</html>