HOWTO: Adding your own ListView action items

sugarcrmdevelopers —  November 22, 2010 — 36 Comments

36 responses to HOWTO: Adding your own ListView action items

  1. 

    Where is the code above placed [what file] if you want to modify the listview action items for a single custom module?

  2. 

    modules//views/view.list.php and modules//controller.php

  3. 

    Following line is wrong

    if ( !emptyempty($_REQUEST[‘uid’]) ) {

    It must be

    if ( !empty($_REQUEST[‘uid’]) ) {

  4. 

    If anyone has trouble with this code, I had to do this:

    return “<a href='#' style='width: 150px' class='menuItem' onmouseover='hiliteItem(this,"yes");' onmouseout='unhiliteItem(this);' onclick="sugarListView.get_checks();if(sugarListView.get_checks_count() New Menu Item“;

    Also, I think John mean to do this for the file locations:
    custom/modules//views/view.list.php
    and
    custom/modules//controller.php

    Good article John!

  5. 

    Whoops. The comments won’t let me put in the full html. On lines 27 to 33 above, take out the whitespaces and returns in the javascript onclick event or the menu won’t show up correctly.

  6. 

    Thanks for catching the typo above; it’s more of a problem with the code formatting plugin we were using.

    As for Swhitlow’s comment, this problem will be fixed in 6.2

  7. 

    where i can write the new action item name .. in which file and at what path.?

  8. 

    For the above example, this would be in the custom/modules/Accounts/views/view.list.php file.

  9. 

    Implemented a custom action awhile ago, and I’m just now coming across an issue when specifying “Select All”. The uid array only contains the first page of records, whereas I would need all ids from the search results. Currently just grabbing the searches where clause from $_SESSION, but was curious if there’s a better way?

    • 

      I ran into the same problem and spent hours on that. Grabbing the query field in $_SESSION seems to be the only solution.

      • 

        Could you kindly give more details what it means “to grab the query field in the $_SESSION” or “grabbing the searches WHERE clause from $_SESSION”?

        We would like to understand how to do this, because we’ve run into the same issue of receiving only the first pages instead of all the selected IDs.

    • 

      How did you fixed the issue when using “Select All”?

  10. 

    Hello? Hi I tried your code on 6.5 community Edition and it did not work. the “<<<eohtml" part is the one that is the error. It says a syntax error. What is this? and by the way, as what I have seen in the code the "{" and "}", is that correct? and also line 31, what is that suppose to be? Please Help. Hope this is still alive.

  11. 

    Let me do that again… I tried your code on 6.5 Community Edition and it did not work. the ” < < < e o html" has been the problem showing in my logs. It says a syntax error occured. Is there something to be done first before inserting this code? and line 31 – 33, is that right? Please help.

  12. 

    Por favor, alguien me puede ayudar a implementar este ejemplo. He tratado utilizando el código pero no funciona. Gracas.

  13. 

    Thanks a lot for this article! I would like to add a button to the listview of several modules not only to a specific module. How can I do this? I am thinking about using javascript to add the button after the page has loaded.. but maybe there as a simpler solution out there?!

  14. 

    I realize this is a few years old now. I was able to add the Button in my custom view list and can verify that it is adding a hidden form field for action.value=’displaypassedids’ and I have in my Controller an Action method for that however when the Button is clicked instead of POSTing to this Controller Action it goes to the root of my Sugar install URL. Any ideas why it would now post to the correct module and url?

  15. 

    Any idea how to do this to add a duplicate button just like in the record view?

  16. 

    I have created a manifest file to install my custom action items so that I can install them and remove them with module loader.
    My problem is that the files custom/modules/Accounts/views/view.list.php and custom/modules/Accounts/controller.php alreay exist.
    Is it possible to create them with a different name? Or how would I tell the manifest file to add/remove my code in the existing files?

Trackbacks and Pingbacks:

  1. Adding a Custom Action item in the List View - SugarCRM Forums - December 29, 2011

    […] Action menu on the List View of one of our custom modules. I followed this developer blog article: Adding your own ListView action items, but I can't get the item that I add in the code to show up in the LIstView's Action menu. Here is […]

  2. Popup Data Picker - Page 2 - SugarCRM Forums - January 1, 2012

    […] […]

  3. Custom action buttons in listview - April 26, 2012

    […] […]

  4. Adding Email as ListView action item for Custom Module - July 5, 2012

    […] […]

  5. Listview Action Button Role Restriction - July 11, 2012

    […] of the Contacts Module i achieved this by following john Mertic's post in the developer zone HOWTO: Adding your own ListView action items now that i have created my new action i am noticed that it is available to all users and in […]

  6. Button - July 11, 2012

    […] […]

  7. SugarCRM Developer Blog » Blog Archive » Removing the stock ListView actions items for a module - August 28, 2012

    […] you remember way back when, we had a good blog post here talking about how to extend the ListView actions menu to put in new action items. But what if there […]

  8. Adding new button on subpanel in Accounts module - October 9, 2012

    […] […]

  9. how create list view buttions mass update,emil ,import here i want add one buttion th - November 12, 2012

    […] […]

  10. Mass Update Customisation - December 2, 2012

    […] […]

  11. add custom action in menu of listview and add it in acl. - April 24, 2013

    […] […]

  12. Adding your own ListView action items | Educational Info - November 11, 2013

    […] https://developer.sugarcrm.com/2010/11/22/howto-adding-your-own-listview-action-items/ […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s