Hi All
I have a trouble problem about GET FORM before insert data into Database. I did not see method $_REQUEST (or $_POST) to get value from FORM .
Everybody may explain to me. I had tried for a long time but not success.
Thanks & Best Regard
Hi All
I have a trouble problem about GET FORM before insert data into Database. I did not see method $_REQUEST (or $_POST) to get value from FORM .
Everybody may explain to me. I had tried for a long time but not success.
Thanks & Best Regard
You can access to the form data using $_REQUEST. Where you were trying to access to the data?
If you want to do something with the data, after or before saving, for example. You have to use a logic_hook.
Information about logic_hooks:
http://www.sugarcrm.com/wiki/index.p...le=Logic_Hooks
Elisabeth Escribano
Webdeveloper
MADCAP verademing in ict
e.escribano@madcap.nl
Schapedrift 89
3371 JJ Hardinxveld-Giessendam
Netherlands
Tel 088 99 088 99
Fax 088 99 088 98
www.madcap.nl
Hi you,
CRM get data from vardefs file, but i did not see method $_REQUEST ( $_POST) that get value from "FORM", then it can insert data into database.
As function save in SugarBean file , i see :
foreach($this->field_defs as $field=>$value)
{
$this->field_defs : to be got from vardefs file, but i action "var_dump($this->$field);" then i see it show data which i had inputed before. I did not understand "why it get value from "FROM". It must have function that get ($_REQUEST) data after "submit" .
You can explain about it .
Thanks & Best Regard .
Can you explain what do you want to achieve, and what are you doing to make it possible?
If you want to change a value from the edit form before it is save or something like that... or if you want to check the values you are sending in the form... I just don't understand what do you want to know.
Can you explain it better?
Elisabeth Escribano
Webdeveloper
MADCAP verademing in ict
e.escribano@madcap.nl
Schapedrift 89
3371 JJ Hardinxveld-Giessendam
Netherlands
Tel 088 99 088 99
Fax 088 99 088 98
www.madcap.nl
Hi You
As Example "Module Account" , At EditView page , When click on save button that insert data into database. I did not understand how crm get value from '<FORM>' in order to insert ? (Meaning using $_POST or $_REQUEST).
You can explain about it.
Thanks & Best Regard.
It uses the $_REQUEST one.
Elisabeth Escribano
Webdeveloper
MADCAP verademing in ict
e.escribano@madcap.nl
Schapedrift 89
3371 JJ Hardinxveld-Giessendam
Netherlands
Tel 088 99 088 99
Fax 088 99 088 98
www.madcap.nl
Hi,
I have just understand about it.
It have 2 case:
Case 1: Save.php -> it called populateFromPost (include/formbase.php)
Case 2: not Save.php file, it used to function pre_save() (SugarController)
Purpose i research about it, i want fix error when user using Tool to HACKING FORM. And data of our will be insert not true.
We can discuss about CRM, it so much wonderful and exciting. Everybody can contact via my YAHOO account: thanhtai862020@yahoo.com, in order to chat or send mail.
Thanks
Hello All,
I would like some help from your side. We have created a module called as quotes for a client in sugarcrm.
We are trying to get the values saved to a text file on aclick event of the button.
we are using the following code
<?php
require_once('include/MVC/View/SugarView.php');
require_once('include/SugarFields/Fields/Base/SugarFieldBase.php');
class OM_QuotationController extends SugarController
{
function action_SaveFile()
{
$this->action_save();
// write the php code here
$fname = $this->module;
$fp = fopen("c:/myfile.txt","w") or exit("unable to open the file");
//require_once('include/SugarFields/MVC/Controller/SugarController.php');
require_once('include/SugarFields/SugarFieldHandler.php');
$sfh = new SugarFieldHandler();
if($fp != null)
{
foreach($this->bean->field_defs as $field => $properties)
{
$type = !empty($properties['custom_type']) ? $properties['custom_type'] : $properties['type'];
$sf = $sfh->getSugarField(ucfirst($type), true);
if($sf != null)
$sf->save($this->bean, $_POST, $field, $properties);
{
fwrite($fp,$field);
fwrite($fp,"\t");
fwrite($fp,$this->bean->id);
fwrite($fp,"\t");
fwrite($fp,$this->bean->$field = $_POST[$field]);
//fwrite($fp,"\t");
//fwrite($fp,$_POST['assigned_user_id']);
fwrite($fp,"\n");
}
}
}
fclose($fp);
}
} // end class
?>
But after using this code we are able to generate only the field names and corresponding bean id's
but no values are being generated.
we need to get the values generated in the text file also.
any help in this regard will be greatly appreciated.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks