Hello, I'd like to create a default value for the required Amount field in Opportunities by multiply a custom field by an integer. Any idea how to go about this? I have access to php files etc. but am an extreme newb
thanks
Hello, I'd like to create a default value for the required Amount field in Opportunities by multiply a custom field by an integer. Any idea how to go about this? I have access to php files etc. but am an extreme newb
thanks
Hi
you can set default value to "Amount field" through view.edit
and you can calculate and assign the value to custom file through this view.edit
Actually the best place to do that is the controller.
Create the script custom/modules/Opportunities/controller.php containing something like that:
CheersPHP Code:<?php
require_once('include/MVC/Controller/SugarController.php');
class OpportunitiesController extends SugarController{
function action_editview() {
$this->view = 'edit';
$this->bean->amount = '<some pre defined value>';
}
}
?>
André Lopes
DevToolKit / Project of the Month - June 2009
Lampada Global Services- Open Source Solutions
Avenida Ipiranga, 318
Bloco B - CJ 1602
São Paulo, SP 01046-010
Brazil
Office: +55 11 3237-3110
Mobile: +55 11 7636-5859
e-mail: andre@lampadaglobal.com
Lampada Global delivers offshore software development and support services to customers around the world.
Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.
I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.
Personnaly i will do it via a logick hook before_save like that the field with be calculated via SugarCRM UI, via Import and via any external action (SOAP)
Controllers lets you do it only via sugarCRM UI.
--------------------
Xavier Rigal
Hello grecstar!!
if you want amount default in the ConvertLead page you need to do a small change for the IF condition in the file 'OpportunityFormBase.php' under the function "getWideFormBody"
old :
if (isset($lead->opportunity_amount)) {
$opp_amount=$lead->opportunity_amount;
} else {
$opp_amount='';
}
new :
if (isset($lead->your_field)) {
$opp_amount=$lead->your_field; { any thing you can multiply here }
} else {
$opp_amount='';
}
this will prefill your 'amount' with the custom value.
- Sandeep Lakshmi
Be Hungry!! Be Foolish!!!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks