SuiteCRM increase autocomplete time in EditView - autocomplete

I'm looking at a request from our customer to either lengthen the autofill or just remove it all together when adding an organisation in EditView.
e.g: https://demo.suiteondemand.com/index.php?module=Opportunities&action=EditView&return_module=Opportunities&return_action=DetailView
If you start typing into "Account Name" box 'A' it'll show all the Organisations starting with A but also it'll autofill the first result into the input box.
Is there a way to stop that autofill of the input box from happening or delay it?
Thanks
Edit: changed title to SuiteCRM

http://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_6.5/Application_Framework/Quicksearch/
I used the Metadata example, and it worked.
[Edit]
To expand on the answer. If you want to remove autofill from any of the boxes you need to add the 'sqsNoAutofill' to achieve this you can do the following:
In a modules editviewdefs.php (e.g. modules/(module)/metadata/editviewdefs.php) locate the name of the input you wish to change e.g:
array (
'name' => 'assigned_user_name',
'label' => 'LBL_ASSIGNED_TO',
),
then add the following:
array (
'name' => 'assigned_user_name',
'label' => 'LBL_ASSIGNED_TO',
'displayParams' => array (
'class' => 'sqsEnabled sqsNoAutofill'
)
),
This will stop an input box with a quicksearch drop down from autofilling.
You can also make the change to the SugarField for Parent
include/SugarFields/Fields/Parent/EditView.tpl (line 51):
<input type="text" .... class="sqsEnabled sqsNoAutofill" .....>
I hope that helps someone else.

Related

Flex Relate field value is blank in List of Sub Panel

There are two modules: Customer & Top Transaction
Relationship between them: 1(Customer):Many(Top Transaction)
There is one 'Flex Relate' field in Top Transaction module.
Now I want to display that 'Flex Relate' value on sub panel list of Top Transaction module.
For that I did changes from studio->Customer->Sub-Panel->Top Transaction.
On Customer detail page under Top Transaction sub panel it's showing only header of 'Flex Relate' field & no value(values are blank).
Does anyone know solution to this?
I'm using 6.5 community edition.
Please check this link for flex relate Flex relate
Try to use relate field instead of flex related i think it will solve your problem .
I know, this is the old question, but here is the solution I have found.
Add these 2 fields in the subpanel metadata and this would show the parent/flex field properly.
However there is still an issue in that, here the target module is fixed. I will update this as soon as I find any solution to it.
Untill that, I think this is achievable in process_record hook. But, I am looking for some generic solution.
'parent_type' =>
array(
'usage' => 'query_only',
),
'parent_name' =>
array(
'width' => '10%',
'vname' => 'LBL_FLEX_RELATE',
'id' => 'parent_id',
'link' => true,
'widget_class' => 'SubPanelDetailViewLink',
'target_module' => 'AOS_Invoices',
'target_record_key' => 'parent_id',
'default' => false,
),

How to pass params in url to a backpack create form

I'm using backpack 3.3 on a laravel 5.5 installation.
I want to prefill two create form fields with two URL passed values.
Say you create a basic backpack crud, named Image.
Normally you can go to domain/admin/image/create to view and fill in the form.
But if I add one or two params in the url, I get a 404.
I guess I should manage the routes file (admin.php)
I tried this way:
Route::group(['prefix' => 'image/{k}/{cid}'], function()
{
CRUD::resource('image', 'ImageCrudController');
});
but still get a 404.
Any suggestions?
Thanks in advance.
Almost all field types have a default option. So when you define them, you can specify a default. And you can always pass a GET parameter for that default. So you can have something like this in your EntityCrudController:
$this->crud->addField[ // Text
'name' => 'title',
'label' => "Title",
'type' => 'text',
'default' => \Request::has('title')?\Request::has('title'):false, // default value
]);
You'd then be able to send you users to yourapp/admin/entity/create?title=your+default+value and have that default value show up in the field.
Hope it helps. Cheers!
it works for me easier
http://127.0.0.1:8000/admin/resultado/create?competencia=2
$this->crud->modifyField("competencia_id",[
'label' => "Competencia",
"default"=>$this->crud->request->query->get('competencia'),
.....

HTML::FormHandler validate select

I'm using HTML::FormHandler to create some forms, and I'd like to be able to validate any select fields on the form by making sure that whatever value submitted was actually a value given to the user. Right now this is how I have my select field set up:
has_field 'choice' => (
type => 'Select',
label => 'Choice',
options => [{value=>"1",label=>"One"},{value=>"2"=>label=>"Two"}],
empty_select => '---Choose an Option---',
apply => [{
check => ['1','2'],
message => 'Must be a value in the list.',
}],
);
Right now this works, but I was wondering if there was a more elegant way to do it? Since HTML::FormHandler already knows what options it has for the field, is there any way to just tell HTML::FormHandler to validate that the what the user choice is in fact one of those options? I've looked through the documentation and can't seem to find it anywhere, but it seems like something that would make sense to have for a field with predefined values. Thanks!
According to the code for HTML::FormHandler::Field::Select this check is already done. Have you tried it?

SugarCRM - How to add "More Info" icon that displays module "Description" field on mouseover

This is for SugarCRM v6.3
I need to add a "More Info" icon to the History subpanel, which, when moused-over, displays the relevant module's Description field, similar to how the More Info icon works in the Accounts ListView.
For starters I added new "History/metadata" folders to custom/modules/ and copied the subpaneldefs.php file from the core History/metadata folder.
In the subpaneldefs file, at the end of each of the module's column definitions, I added this as a test:
array ( 'customCode' => '<img src="themes/Sugar/images/info_inline.png"></img>', ),
That didn't seem to affect anything at all.
Not sure if it was just that I needed more than an image for the column to show, I then tried adding all of the code I thought was supposed to go there:
array (
'name' => 'nothing',
'module' => 'Notes',
'related_fields' => array ('id'),
'customCode' => '<a id="adspan_{$ID}" href="index.php?module=Notes&action=DetailView&record={$ID}" onmouseover="return SUGAR.util.getAdditionalDetails(\'Notes\',\'{$ID}\',\'adspan_{$ID}\');" onmouseout="return SUGAR.util.clearAdditionalDetailsCall()"><img src="themes/Sugar/images/info_inline.png"></img></a>'
),
This is, as you can see, intended for the Notes in the History subpanel, and I changed it accordingly for each of the other modules' column definitions in the subpaneldefs.php file. I modeled the code after some custom code I found that someone else here at work did for a dashlet, which shows details when an account name is moused over.
Unfortunately, that didn't work, either.
How do I accomplish this?
The only way to do this is by defining a new SugarWidget field for the field in question. Here's a good guide I found for it:
http://www.mediaart.lt/programming/sugarcrm-adding-custom-field-in-subpanel/

Add a dropdown list as custom field in magento

I added custom fields as described in magento add custom input field to customer account form in admin
But I want a select list, not only a text input one. I don't know which kind of parameter I have to set and how to tell the list of possible values.
Please help :)
Thanks,
Plantex
Where you might do something like:
$setup->addAttribute('customer', 'custom_attribute', array(
'type' => 'text',
'label' => 'Customer Custom Attribute',
));
Use these values instead:
$setup->addAttribute('customer', 'custom_attribute', array(
'type' => 'int',
'label' => 'Customer Custom Attribute',
'input' => 'select',
'source' => 'eav/entity_attribute_source_boolean',
));
The type is int because you will typically be storing the index of the value chosen, not the value itself. The input is select so the admin renderer knows which control to use. The source shown here is a common example, it provides an array of "Yes" and "No" values with numeric indexes.
There are many source models already in the Magento code that you can use and you can create your own too, look at any existing one to see how it returns an array. If you make your own and if it uses text indexes instead of numeric then the type will have to be changed back to text.
Try adding this at your module setup file
'value' => array('notate_to_zero'=>array(0=>'Bleu',0=>'Rouge',0=>'Vert',0=>'Violet',0=>'Noir',0=>'Orange'))
),
or look at this --> http://inchoo.net/ecommerce/magento/how-to-create-custom-attribute-source-type/