Results 1 to 7 of 7

Thread: Disable custom fields in edit view

  1. #1
    detour is offline Member
    Join Date
    Apr 2009
    Posts
    10

    Default Disable custom fields in edit view

    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?

  2. #2
    crmbalah is offline A Prolific Poster
    Join Date
    Mar 2009
    Location
    chennai
    Posts
    418

    Default Re: Disable custom fields in edit view

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

  3. #3
    detour is offline Member
    Join Date
    Apr 2009
    Posts
    10

    Default Re: Disable custom fields in edit view

    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?

  4. #4
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Disable custom fields in edit view

    You can just add the attribute

    PHP Code:
    'type' => 'readonly'
    on field definition at editviewdefs.php

    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.

  5. #5
    detour is offline Member
    Join Date
    Apr 2009
    Posts
    10

    Default Re: Disable custom fields in edit view

    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?

  6. #6
    detour is offline Member
    Join Date
    Apr 2009
    Posts
    10

    Default Re: Disable custom fields in edit view

    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:"^,^":", "}'
              ),

  7. #7
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Disable custom fields in edit view

    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:

    PHP 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>";
            } 
    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 3
    Last Post: 2007-12-27, 01:53 PM
  2. Replies: 4
    Last Post: 2007-12-03, 02:42 PM
  3. Replies: 13
    Last Post: 2007-10-04, 05:53 AM
  4. Replies: 1
    Last Post: 2007-02-06, 09:21 PM
  5. Replies: 2
    Last Post: 2006-12-15, 03:00 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •