Hello, I am looking for a way to disable custom fields I have created in the edit view. The data is populated via SOAP and is intended to be viewable but not changed. Suggestions?
Hello, I am looking for a way to disable custom fields I have created in the edit view. The data is populated via SOAP and is intended to be viewable but not changed. Suggestions?
Hi
Go to custom\modules\Accounts\metadata\editviewdefs.php
customize the you particular field like this
Code:array ( 'name' => 'name', 'label' => 'LBL_NAME', 'customCode'=>'<input type="text" value="{$fields.name.value}" readonly>' ),
That looks like exactly what I need. Could you please provide an example of how to accomplish this with a dropdown and multiselect as well?
You can just add the attribute
on field definition at editviewdefs.phpPHP Code:'type' => 'readonly',
Cheers
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.
even better! thanks andopes. This worked, but seems to have a strange effect with multiselects. They appear with the delimiter ^,^ between entires, any quick solution to clean that up?
To answer my own question (and combine the two solutions) this worked for me:
Code:array ( 'name' => 'my_custom_multiselect_c', 'label' => 'LBL_NAME', 'type' => 'readonly', 'customCode'=>'{$fields.my_custom_multiselect_c.value|replace:"^,^":", "}' ),
Hi detour
Although it is working it has a limitation: It display the database value instead of language value.
Create a controller for your module, implement the action_editview and add this code inside such function:
CheersPHP Code:$my_custom_multiselect_c_list = explode("^,^", $this->bean->my_custom_multiselect_c);
$this->bean->my_custom_multiselect_c = '';
foreach($my_custom_multiselect_c_list as $my_custom_multiselect_c) {
$this->bean->my_custom_multiselect_c.= "<LI>{$app_list_strings['my_custom_multiselect_c_list'][$my_custom_multiselect_c]}</LI>";
}
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.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks