Hello,
This might be something obvious to the experts so please bear with me. I have a rather simple use case - very often when creating a quote I find a product missing and need to quick create it, While I can quick create an account and a bunch of other stuff I cannot seem to find the customization to quick create from the product search view. How would I do this?
Hey
you can enable the quick create of products in popup using the following way
- create file modules/AOS_Products/AOS_ProductsFormBase.php
Add contents:
<?php
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
require_once('include/SugarObjects/forms/PersonFormBase.php');
class AOS_ProductsFormBase extends PersonFormBase
{
public $moduleName = 'AOS_Products';
public $objectName = 'AOS_Products';
function handleSave($prefix, $redirect=true, $useRequired=false){
require_once('include/formbase.php');
$focus = new AOS_Products();
$focus = populateFromPost($prefix, $focus);
$focus->save();
}
}
- Edit the custom/modules/AOS_Products/metadata/popupdefs.php file [if the file does not exist copy it from the modules/AOS_Products/metadata/popupdefs.php]
Add in the file
'create' => array (
'formBase' => 'AOS_ProductsFormBase.php',
'formBaseClass' => 'AOS_ProductsFormBase',
'getFormBodyParams' =>
array (
0 => '',
1 => '',
2 => 'AOS_ProductSave',
),
'createButton' => 'LNK_NEW_PRODUCT',
),
It should look like this