Hi Best Developers!.
I have created new fields in Contacts Module and I want to connect my new fields to SQLServer DB instead of default mysql db.
Can I do this a how?
Thanks a lot.
Hi Best Developers!.
I have created new fields in Contacts Module and I want to connect my new fields to SQLServer DB instead of default mysql db.
Can I do this a how?
Thanks a lot.
Hi!
I think it is better to define function for new fields in vardefs.
Do you know something about this.
I may post an example if you need. Just ask!
Best regards,
Hi.
Please give me an example of this.
Thanks a lot
Hi!
1.First of all you need to define field:
so, new for you is:PHP Code:'my_field' =>
array (
'required' => true,
'name' => 'my_field',
'vname' => 'LBL_MY_FIELD',
'type' => 'varchar',
'len' => '100',
[B] 'function' =>
array (
'name' => 'getMyRez',
'returns' => 'html',
'include' =>'custom/MyFunc/func.php',
),[/B]
),
'function' =>
array (
'name' => 'getMyRez', - this function will return value
'returns' => 'html', - type of result
'include' =>'custom/MyFunc/func.php', - file whitch contain this function
),
2. Add to all layouts that you need
simply:
3.create file 'custom/MyFunc/func.php'PHP Code:array('my_field'),
there :PHP Code:if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
function getMyRez($focus,$name,$value,$view){
if($view == 'DetailView' ){
$rez = your script result for detail view.
}elseif($view == 'EditView' ){
$rez = your script result for edit view.
}if($view == 'ListView' ){
$rez = your script result for list view.
}
return $rez;
}
$focus - object
$name - field name
$value - field value
$view ( editview, listview, detailview)
That's all!
letrium - THANKS!
Finally a good example of using a function to render a field in the forums.
Would you consider posting the example and some comments to the Wiki?
(In respond to SugarDev.net's request to help with the Wiki)
M
--
Marnus van Niekerk
There are only 10 types of people in the world
those who can read binary and those who don't
Modules:
CE Teams - Upgrade safe teams module for Community Edition
FieldACL - Field Level Access Control for Community Edition
EditLogicHooks - Create and edit Logic Hooks from the Admin GUI
FlexibleChartDashlet - Display any data in a Dashlet Chart
DocumentThumbnails - Thumbnails for Documents module
Many questions can be answered by reading the Developers Manual
Ok!
I will write after understanding how to work in WIKI.
Hi!
Thank you for this information.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks