When trying with a module i built i get the following errors.
[Tue Oct 30 14:53:21.679340 2018] [:error] [pid 22124] [client 172.16.1.9:7895] PHP Notice: Undefined variable: controller in /var/www/html/include/MVC/Controller/ControllerFactory.php on line 83, referer: http://172.16.1.89/index.php?action=ajaxui
[Tue Oct 30 14:53:21.679574 2018] [:error] [pid 22124] [client 172.16.1.9:7895] PHP Fatal error: Uncaught Error: Call to a member function setup() on null in /var/www/html/include/MVC/Controller/ControllerFactory.php:83\nStack trace:\n#0 /var/www/html/include/MVC/SugarApplication.php(98): ControllerFactory::getController('CoMa_Plots')\n#1 /var/www/html/index.php(52): SugarApplication->execute()\n#2 {main}\n thrown in /var/www/html/include/MVC/Controller/ControllerFactory.php on line 83, referer: http://172.16.1.89/index.php?action=ajaxui
[Tue Oct 30 14:53:21.907496 2018] [:error] [pid 22122] [client 172.16.1.9:7896] script '/var/www/html/cache/index.php' not found or unable to stat, referer: http://172.16.1.89/cache/themes/SuiteP/css/Dawn/style.css?v=rQSuGegA1ftiv_z5tsfAAw
So, the view gets customized, your new option is in the menu, but when you click it, it throws that error?
You have to track what the files for your new custom module have, since you are extending classes and they might be different classes, or already have their own extensions which you canât simply overlook.
So for example when you say
class CustomAccountsController extends SugarController
this will not play well if the custom module is already extending SugarController. In this case you would have to extend the extension, not the original.
I have published the module so i have access to all of itâs files and code. I have search through every file can not not find any class that extends Sugarcontroller.
Iâm afraid I donât how to help any further, I guess youâll have to follow those PHP errors where they lead you. Something about the class construction, the overrides, etc., is a bit different for custom modules, so the List view customization needs to be adapted, but I donât know what it is, sorry
While youâre looking into this - I seem to remember there was a difficulty getting all the passed ids if the user clicks to âselect allâ. Not just âall displayed in this listâ, but really âallâ, including the other pages of the list.
Have you tried this? Can you get a complete list, or just a list of the currently displayed items?
Increasing the number of records in List views is done in Admin / System settings, if Iâm not mistaken.
I never found a solution for this issue, no. But I didnât devote much time to it, I donât think it should be too hard for someone who understands PHP and the way these parameters are being passed from screen to screen in SuiteCRM.
I remember there were some discussions about this online, since that code in my gists is not mine, it is something I borrowed from the SugarCRM forums, it was like âthe officialâ example of adding an item to the list viewâs actions, so there are other people discussing this:
Hi,
I used the suggested approach above with defining a custom controller, which also works fine. I am currently having the problem that I want to return âcleanlyâ to the list view where I selected the records before.
Two questions:
The sugar_die is obviously not good there but just using a regular return does not return you to the list view. Is there a way to return to the list view I was coming from?
I would like to return to the same page I was coming from. If I have like records that fill 20 pages, and I was on page 3 before and added a few records with my custom bulk select, I would like to continue with selecting additional records afterwards and donât start over from page 1)
What is your action doing? Instead of going into a different page and returning, perhaps you could just do an Ajax call and never leave the page at all.
My action just picks some fields from the selected records and creates a bean in another module. Nothing fancy but the user would then most likely continue on the next pages of the Listview. If they start over every time on the first page this wonât work. How would this AJAX approach look like ?
In buildMyMenuItem, in the Javascript part, you donât need to submit the form. Instead, just use JQuery to call $.ajax or $.getJSON to run an action on the controller, one that doesnât return any view.
I canât spell it out for you in detail - itâs easy if youâve done it before, difficult if you havenât. I learned this by copying code from inlineEdit.php and InlineEdit.js
The controller part is similar to what is above, in this topic. But you donât need to echo anything, you just do your job and return.
Thank you I got it working with an AJAX, I am close now but how do I uncheck the rows selected for mass update? When my call returns the values are still checked and I donât find the call to remove the checks from the mass update object?