Results 1 to 8 of 8

Thread: How to make Subject field in History Subpanel a dropdown

  1. #1
    anicolais is offline Senior Member
    Join Date
    Nov 2009
    Posts
    99

    Default How to make Subject field in History Subpanel a dropdown

    Is it possible to make the 'Subject' field in the History sub panel in accounts a drop down list? If so how do i do it and how can I set the value list?

    Sugar 5.5
    Thanks

  2. #2
    datasponge is offline Sugar Community Member
    Join Date
    Mar 2008
    Location
    San Jose, CA, USA
    Posts
    553

    Default Re: How to make Subject field in History Subpanel a dropdown

    Hi anicolais,

    The subpanels simply display data already entered in other modules. A dropdown specifies the type of input on the edit view. Also, history merges data from multiple different modules (Notes, Emails, Tasks, Meetings, Calls, etc).

    What are you trying to accomplish?

    You can set the notes subject field (or other fields) to a dropdown in Notes Edit View using a vardefs extension. Then the value selected in the dropdown will appear as text in the subpanel.

    Explain what you want to do, then we can give more detaiils how to do it.

    Phil

  3. #3
    anicolais is offline Senior Member
    Join Date
    Nov 2009
    Posts
    99

    Default Re: How to make Subject field in History Subpanel a dropdown

    Basically I am trying to make a content management system. Long story short the only way the user can create records in notes is through the history sub panel in the accounts module. Each note or document that the user uploads to the system through the sub panel falls into a certain category. This is where the subject field comes in. I want this field to only allow the user to enter certain values into it such as Twitter, Facebook, RFP, etc. I want this to be shown in this sub panel and in the summary view still so i thought making the subject field a dropdown would be the easiest way?

  4. #4
    datasponge is offline Sugar Community Member
    Join Date
    Mar 2008
    Location
    San Jose, CA, USA
    Posts
    553

    Default Re: How to make Subject field in History Subpanel a dropdown

    So if I follow correctly, your user will click the Create Note or Attachment button and on the form that gets displayed you want the Subject field to be a dropdown.

    If this is the case, then you are no longer in the subpanel, but in the Notes Edit View since you're specifically creating a Note now. You can also create a note by going to the Activities tab and clicking Create Note from the Shortcuts menu, which gets you to the same place.

    So all you need to do is customize the Notes name field to be an enum and create the dropdown for it.

    Go to Admin and open Dropdown Editor.
    Create a dropdown like notes_subject_list, enter the values you want in the list and save it

    Now change Notes name field to be type enum:
    Create a new file under <sugarroot>/custom/Extension/Notes/Ext/Vardefs. It can have any name e.g. name_enum.php
    You can create the folders if they do not exist.
    Add the following contents:
    PHP Code:
    <?php
      $dictionary
    ['Note']['fields']['name']['type'] = 'enum';
      
    $dictionary['Note']['fields']['name']['options'] = 'notes_subject_list';
    ?>
    Save the file and do a Quick Repair and Rebuild and it will make the changes.

    I think that's it, but I did not try it myself. I have not changed the name field before, so you may have issues like keeping this as a link in the subpanel... not sure. But try it and see. If you have problems, you can back it out by deleting the file from that folder and doing another repair.

    Phil

  5. #5
    anicolais is offline Senior Member
    Join Date
    Nov 2009
    Posts
    99

    Default Re: How to make Subject field in History Subpanel a dropdown

    Thats awesome works great!!! Thanks!!!
    Last edited by anicolais; 2010-02-26 at 02:26 PM.

  6. #6
    offcourse is offline Sugar Community Member
    Join Date
    Jul 2008
    Posts
    28

    Default Re: How to make Subject field in History Subpanel a dropdown

    Hi

    I tried this approach to make the Call Subject a dropdown box, but it didn't work.

    Can you help?

    I created the file "\sugarceTEST\custom\modules\Calls\Ext\Vardefs\sub ject_enum.php" with the following code:

    <?php // created: 2010-09-09 11:02:00
    $dictionary['Call']['fields']['name']['default']='Angariacao';
    $dictionary['Call']['fields']['name']['type'] = 'enum';
    $dictionary['Call']['fields']['name']['options'] = 'calls_subject_list';
    ?>

    Rebuilt and it the subject still appears as text field.

    Thanks

  7. #7
    mikesolomon is offline Sugar Community Member
    Join Date
    Feb 2008
    Location
    UK
    Posts
    1,467

    Default Re: How to make Subject field in History Subpanel a dropdown

    Quote Originally Posted by offcourse View Post
    Hi

    I tried this approach to make the Call Subject a dropdown box, but it didn't work.

    Can you help?

    I created the file "\sugarceTEST\custom\modules\Calls\Ext\Vardefs\sub ject_enum.php" with the following code:

    <?php // created: 2010-09-09 11:02:00
    $dictionary['Call']['fields']['name']['default']='Angariacao';
    $dictionary['Call']['fields']['name']['type'] = 'enum';
    $dictionary['Call']['fields']['name']['options'] = 'calls_subject_list';
    ?>

    Rebuilt and it the subject still appears as text field.

    Thanks
    wrong file

    try custom/Extension/modules/Calls/Ext/Vardefs/subject_enum.php
    Mike Solomon
    Development Manager
    Ivy Ltd
    www.ivy.ltd.uk]www.ivy.ltd.uk

    php version 5.2.6
    MySql 5.1.59

  8. #8
    offcourse is offline Sugar Community Member
    Join Date
    Jul 2008
    Posts
    28

    Default Re: How to make Subject field in History Subpanel a dropdown

    Worked like a charm.

    Many thanks.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. subpanel - make a field align right
    By mikesolomon in forum Developer Help
    Replies: 12
    Last Post: 2012-05-18, 02:53 PM
  2. Replies: 18
    Last Post: 2010-05-05, 09:21 AM
  3. Replies: 7
    Last Post: 2010-05-05, 07:42 AM
  4. Replies: 3
    Last Post: 2009-12-04, 04:53 PM
  5. Replies: 2
    Last Post: 2008-12-18, 09:31 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
  •