<div dir="ltr">Hi I've been had same problem with ticket related to project. Anyone have idea how to manage?</div><div class="gmail_extra"><br><div class="gmail_quote">2015-10-26 14:57 GMT+01:00 ardi zeneli <span dir="ltr"><<a href="mailto:zeneliiardi@gmail.com" target="_blank">zeneliiardi@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello, <div><br></div><div>i am trying to create a relation between the modules "Sales Orders" and "Campaigns" using a uitype 10 field. For this i am using the code below, but it doesn't seem to work correctly. I have tried modifying the code by replacing "get_related_list" with "get_dependents_list", or even from the database in the vtiger_relatedlists table, modifying the name from get_related lists to get_dependents or get_salesorders, as other existing relations but still nothing. The problem is that when i select a campaign from the uitype10 field in the Sales Order, the result isn't shown in the related list in the Campaigns module, only when i select it manually from the related list in the Campaigns module the record is added to the list. The relation is added also in the vtiger_fieldmodulerel with the correct field id of the uitype 10 field. </div><div>Is there anything else that i can check, or another way to do this?</div><div><br></div><div>Thanks</div><div><br></div><div><div><?php</div><div>// Turn on debugging level</div><div>$Vtiger_Utils_Log = true;</div><div>require_once('vtlib/Vtiger/Module.php');</div><div>require_once('vtlib/Vtiger/Block.php');</div><div>require_once('vtlib/Vtiger/Field.php');</div><div>$module = Vtiger_Module::getInstance('SalesOrder');</div><div>$block = Vtiger_Block::getInstance('LBL_SO_INFORMATION',$module);</div><div>$field = new Vtiger_Field();</div><div>$field->label = 'Related Campaign';</div><div>$field->name = 'campagna_related';</div><div>$field->column = 'campagna_related';</div><div>$field->columntype = 'VARCHAR(255)';</div><div>$field->uitype = 10;</div><div>$field->typeofdata = 'V~O';</div><div>$block->addField($field);</div><div>$block->save($module);</div><div>$field->setRelatedModules(Array('Campaigns')); </div><div><br></div><div>$module = Vtiger_Module::getInstance('Campaigns');</div><div>$module->setRelatedList(Vtiger_Module::getInstance('SalesOrder'), 'SalesOrder',</div><div>Array('ADD'),'get_related_list');</div><div>?></div></div><div><br></div></div>
<br>_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Simone Travaglini<br>328 5499846<br>Linkedin: Simone Travaglini <br><br><br><span style="color:rgb(51,204,0)">Rispetta l'ambiente: non stampare questa mail se non ti è veramente necessario!</span><br></div>
</div>