Populating dropdown I got max 20 entries whereas I should get more (v7.6.1)

Hello everyone,

The code below populates my dropdown, but if more than 20 elements are expected, only the first 20 elements appears in my dropdown.

Someone knows how I can get all of them in my dropdown? Sugar version is 7.6.1.

                        var cpt = 1;

                        var urlc = app.api.buildURL("myCustomModule", null, null, {

                            "filter": [{

                                "psc": "1"

                            }]

                        });

                        app.api.call('read', urlc, null, {

                            success: function (data) {

                                options[0] = "";

                                data.records.forEach(function(i)

                                {

                                    options[cpt] = i.name;

                                    cpt++;

                                }

                                );

                      

                                var toto = new Backbone.Model();

                                toto.set('s1', []);

                                s1.items = options;

                                s1.render();

                            }

                        });

Thanks ! Best regards.

Parents
  • If you look at http://<your sugarcrm url>/rest/v10/help in your browser you will see that GET/<module> has a parameter max_num and the default is 20

    Add max_num to your parameters to increase the limit, as far as I can tell, using -1 will get ALL results.

    HTH

    FrancescaS

Reply
  • If you look at http://<your sugarcrm url>/rest/v10/help in your browser you will see that GET/<module> has a parameter max_num and the default is 20

    Add max_num to your parameters to increase the limit, as far as I can tell, using -1 will get ALL results.

    HTH

    FrancescaS

Children
  • Hello Francesca !

    Thank you very much for your answer. That help me much and solve the limit of records ans solved my trouble.

    Just one thing in your answer I haven't understand and I apologize for that. Where can you see max_num = 20 by default? I just can't find it. From your answer I checked here https://developer.sugarcrm.com/2014/02/28/sugarcrm-cookbook1/ I can find the info.

    And if in my url I do something like this :

    localhost/mySugar/rest/v10/myModule => {"error":"need_login","error_message":"No valid authentication for user."}

    Mod_rewrite is enabled.

    Thanks again Francesca !

    Best regards