[Vtigercrm-developers] FW: Relationship between Projects and Accounts
Mihai Oprea
mihai.oprea at sphs.ro
Mon Jul 8 13:49:16 UTC 2013
Hello Adam, thank you for your short response!
Well no, can you tell me where I can find it?
Also I want to tell you that I'm using vTiger v5.4.0
Another thing that I want to do is to add the Organizations field that is related to the organizations module as a normal field not on the "more information" tab.
I've tried the following thing https://forums.vtiger.com/viewtopic.php?f=96&t=34329 customized to my need like this:
$fieldInstance9 = Vtiger_Field::getInstance('Accounts', $moduleInstance);
if(!$fieldInstance9) {
$fieldInstance9->name = 'Organizations';
$fieldInstance9->label= 'Organization';
$fieldInstance9->uitype = 10;
$fieldInstance9->column = 'Organizations';
$fieldInstance9->typeofdata = 'V~O';
$blockInstance->addField($fieldInstance9);
$fieldInstance9->setRelatedModules(Array('Accounts'));
}
else echo 'Cannot create field Organizations';
And after I add the module when I try to access it, I only have a blank white page only with the menu bar.
Have I done something wrong?
Thank you and have a good day!
----
Mihai Oprea
IT Specialist
mihai.oprea at sphs.ro<mailto:mihai.oprea at sphs.ro>
From: vtigercrm-developers-bounces at lists.vtigercrm.com [mailto:vtigercrm-developers-bounces at lists.vtigercrm.com] On Behalf Of Adam Heinz
Sent: 8 iulie 2013 15:27
To: vtigercrm-developers at lists.vtigercrm.com
Subject: Re: [Vtigercrm-developers] FW: Relationship between Projects and Accounts
Have you looked at CRMEntity.deleteRelation?
On Mon, Jul 8, 2013 at 5:28 AM, Mihai Oprea <mihai.oprea at sphs.ro<mailto:mihai.oprea at sphs.ro>> wrote:
Hello,
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.
I tried to use the unset function like this:
$moduleInstance->unsetRelatedList($accountsModule, $relationLabel, Array('ADD','SELECT'));
I get the following output: "Unsetting relation with Accounts ... DONE" but nothing happens in my module.
Thank you!
----
Mihai Oprea
IT Specialist
mihai.oprea at sphs.ro<mailto:mihai.oprea at sphs.ro>
From: vtigercrm-developers-bounces at lists.vtigercrm.com<mailto:vtigercrm-developers-bounces at lists.vtigercrm.com> [mailto:vtigercrm-developers-bounces at lists.vtigercrm.com] On Behalf Of Juan Pablo Botero
Sent: 22 martie 2013 15:59
To: vtigercrm-developers at lists.vtigercrm.com<mailto:vtigercrm-developers at lists.vtigercrm.com>
Subject: Re: [Vtigercrm-developers] Relationship between Projects and Accounts
That works pretty cool.
Thanks for your help
2013/3/21 Juan Pablo Botero <juanpabloboterolopez at gmail.com<mailto:juanpabloboterolopez at gmail.com>>
Thanks Richard and Alan.
We think that is the way to add the relationship, gonna apply and tell the results.
2013/3/20 Alan Lord (News) <alanslists at gmail.com<mailto:alanslists at gmail.com>>
On 20/03/13 04:31, Juan Pablo Botero wrote:
Richards, thanks for answer.; i think that is the way.
But it seems to work with a new modules, the modules that already exist,
what file can i edit?
You just need to create your vtlib script in the same way as you do for a new module.
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):
<?php
// Turn on debugging level
$Vtiger_Utils_Log = true;
include_once('vtlib/Vtiger/Menu.php');
include_once('vtlib/Vtiger/Module.php');
include_once('F1k_Extensions/libs.php');
// Get a handle to the accounts module
$module = Vtiger_Module::getInstance('Accounts');
// Get our custom block
$block_custom = Vtiger_Block::getInstance('Custom Information', $module);
// Add the field to hold IP Addresses
// Remove if already exiting
$field_ipadds = Vtiger_Field::getInstance('ipadds', $module);
if ($field_ipadds != false) {
$field_ipadds->delete();
}
$field_ipadds = new Vtiger_Field();
$field_ipadds->name = 'ipadds';
$field_ipadds->label= 'IP Addresses';
$field_ipadds->column = 'ipadds';
$field_ipadds->columntype = 'TEXT';
$field_ipadds->uitype = 21;
$field_ipadds->typeofdata = 'V~O';
$block_custom->addField($field_ipadds);
?>
HTH
Al
--
Libertus Solutions
http://www.libertus.co.uk
_______________________________________________
http://www.vtiger.com/
--
Cordialmente:
Juan Pablo Botero
Administrador de Sistemas informáticos
Fedora Ambassador for Colombia
http://www.jpilldev.net
--
Cordialmente:
Juan Pablo Botero
Administrador de Sistemas informáticos
Fedora Ambassador for Colombia
http://www.jpilldev.net
_______________________________________________
http://www.vtiger.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20130708/77ecfa86/attachment-0001.html>
More information about the vtigercrm-developers
mailing list