How to add additional grouped address to edit and detail view? - sugarcrm

SugarCRM 6.5 has built in grouped address fields in the Lead Module for the Primary Address and for the Alternate Address that can be used with the Edid and Detail view. I have been able to add the fields for a third address, but when I add the new address field to the edit view and detail view, it does not show the grouped fields, just a single field.
According to the documentation I can use the customCode option in the Detail View and Edit View definitions, but I have not been able to succesfully get this working. Does anyone have any suggestions on how to accomplish this?

You must give a prefix for all the address fields like 'billing' or 'primary'. Then your address fields would be of the form:
billing_address_street
billing_address_city
billing_address_state
billing_address_postalcode
billing_address_country
In Editview you can show this as a single grouped address by adding the below code in editviewdefs. Replace 'billing' by whatever prefix you have used.
array (
'name' => 'billing_address_street',
'hideLabel' => true,
'type' => 'address',
'displayParams' =>
array (
'key' => 'billing',
'rows' => 2,
'cols' => 30,
'maxlength' => 150,
),
),

If you have a custom address field that has been added through studio, then sugarcrm won't automatically group the address fields, because the field names end in _c. This is a reported bug: https://web.sugarcrm.com/support/issues/cbb00e33-351b-5448-2e5f-4eaf7551f347
There is a blog post here explaining how to work around it:
http://www.profilingsolutions.com/archive/custom-address-fields/
(basically - remove the _c suffix from the created address fields in the database and fix up the vardefs).

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,
),

SuiteCRM increase autocomplete time in EditView

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.

TYPO3 modify backend table

EDIT: TYPO3 version 4.7
there is table Create Website user with many tabs.
I am able to add new tab with my own data using:
$test = array(
'tx_promconf_send_email' => array(
'exclude' => 0,
'label' => 'HAHAHA',
'config' => array(
'type' => 'input'
,)));
t3lib_div::loadTCA('fe_users');
t3lib_extMgm::addTCAcolumns('fe_users',$test,1);
t3lib_extMgm::addToAllTCAtypes('fe_users','--div--;Documents;;;;1-1-1,tx_promconf_send_email');
But I am not able to put my input to already existing tabs. Also I was not able to find some explanation of this string 'fe_users','--div--;Documents;;;;1-1-1,tx_promconf_send_email'.
Is there an option how to modify existing tabs? Where can I found the name of the tab? I tried to use instead of --div-- name of the tab and it does not work.
This weird string is hardly documented. You can find the TCA Documentation here.
If you want to insert it to an existing tab, just do it by finding a field within the desired tab where you want to put your new field after or before.
For example:
t3lib_extMgm::addToAllTCAtypes('fe_users','tx_promconf_send_email', '', 'after:last_name');
Your field will now be displayed after the field "last_name", and so within the tab "Personal Data". You can also use "before:fieldname" to insert your field before a field.

Autofill Field in SugarCRM

In Quotes module (SugarCRM Pro) i made one field region (drop down). When we select billing account name in quote name then address automatically fill up . I want that region field will automatically fill up as i have made same region in account module . I want it will automatically fetch the region from the account module as it fetch all the address.
in your editviewdefs for that module, on the field array element, you need to add something like:
'displayParams' => array( 'field_to_name_array' => array( 'FIELDFROMACCOUNTS' => 'FIELDTOPOPULATE', 'FIELDFROMACCOUNTS2' => 'FIELDTOPOPULATE2'),),
Replace the all caps words with your fields and you should be ready to go. Keep in mind that relate fields have a hidden field that is used for the ids and make sure that you are populating it properly.
Cheers.

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/