Technical issues have a funny way of resurfacing sometimes. For example, a number of months ago I came across a problem relating to the SOAP API and Users module and more recently I come across another oddity involving both elements. This time around, however, it seems the problem is broader in scope, applicable to all modules.
For those of you that work with the SOAP API on a regular basis, take note that there is an issue with the get_entry_list() method. If you are unfamiliar with this method, it is used to retrieve a list of records from a given module such as a list of all contacts whose last name is "Smith."
In addition to filtering the data retrieved, the method also permits one to control the number of records retrieved. This is helpful because it allows us to limit the amount of bandwidth and calls used to interact with SugarCRM.
Going back to our example, we could use it to retrieve 20, 50 or 100+ records with one call, by simply specifying any of those numbers as a parameter to the method. This is also where we can run into trouble. As it turns out, there is an issue with the interpretation of this number. In short, if one attempts to retrieve a greater number of records than what exists in the target module, the method fails and none of the records are returned.
In most cases, it is unlikely one would run into this problem, but if one is working with a module that typically does not contain a large number of records, the chances increase. The Users module exposed it to me because I was attempting to get a list of all users defined for a given instance. Because it is not a large implementation, retrieving 50 records in one call seemed feasible. But the process continually failed, leading me to the realization that the Users module only had approximately 30 records.
Once I updated my code to retrieve an equal number of records as what existed in the module, all was fine.