How to get the module entries by for the specific modules with maxresults option ? Help me with an example

How to get the specific module’s entries with maxresults option? Help me with an example

Hi,
you could show us what you’ve tried so far - maybe we can help you then. But did you have a look at the methods signature?

  /**
     * Retrieve a list of beans.  This is the primary method for getting list of SugarBeans from Sugar using the SOAP API.
     *
     * @param string $session -- Session ID returned by a previous call to login.
     * @param string $module_name -- The name of the module to return records from.  This name should be the name the module was developed under (changing a tab name is studio does not affect the name that should be passed into this method)..
     * @param string $query -- SQL where clause without the word 'where'
     * @param string $order_by -- SQL order by clause without the phrase 'order by'
     * @param integer $offset -- The record offset to start from.
     * @param array $select_fields -- A list of the fields to be included in the results. This optional parameter allows for only needed fields to be retrieved.
     * @param array $link_name_to_fields_array -- A list of link_names and for each link_name, what fields value to be returned. For ex.'link_name_to_fields_array' => array(array('name' =>  'email_addresses', 'value' => array('id', 'email_address', 'opt_out', 'primary_address')))
     * @param integer $max_results -- The maximum number of records to return.  The default is the sugar configuration value for 'list_max_entries_per_page'
     * @param bool $deleted -- false if deleted records should not be include, true if deleted records should be included.
     * @return array 'result_count' -- integer - The number of records returned
     *               'next_offset' -- integer - The start of the next page (This will always be the previous offset plus the number of rows returned.  It does not indicate if there is additional data unless you calculate that the next_offset happens to be closer than it should be.
     *               'entry_list' -- Array - The records that were retrieved
     *                 'relationship_list' -- Array - The records link field data. The example is if asked about accounts email address then return data would look like Array ( [0] => Array ( [name] => email_addresses [records] => Array ( [0] => Array ( [0] => Array ( [name] => id [value] => 3fb16797-8d90-0a94-ac12-490b63a6be67 ) [1] => Array ( [name] => email_address [value] => hr.kid.qa@example.com ) [2] => Array ( [name] => opt_out [value] => 0 ) [3] => Array ( [name] => primary_address [value] => 1 ) ) [1] => Array ( [0] => Array ( [name] => id [value] => 403f8da1-214b-6a88-9cef-490b63d43566 ) [1] => Array ( [name] => email_address [value] => kid.hr@example.name ) [2] => Array ( [name] => opt_out [value] => 0 ) [3] => Array ( [name] => primary_address [value] => 0 ) ) ) ) )
     * @exception 'SoapFault' -- The SOAP error, if any
     */
    Method [  public method get_entry_list ] {
      

      - Parameters [10] {
        Parameter #0 [  $session = NULL ]
        Parameter #1 [  $module_name = NULL ]
        Parameter #2 [  $query = NULL ]
        Parameter #3 [  $order_by = NULL ]
        Parameter #4 [  $offset = NULL ]
        Parameter #5 [  $select_fields = NULL ]
        Parameter #6 [  $link_name_to_fields_array = NULL ]
        Parameter #7 [  $max_results = NULL ]
        Parameter #8 [  $deleted = false ]
        Parameter #9 [  $favorites = false ]
      }
    }

{

“session”:“mysessionid”,

“module_name”: “Users”,“max_results”:“2”

}

is SQL query compulsory or optional?

can you give one example?

I guess you should use arguments 2-6 empty (if you don’t need them) and then you can use max_results like in your example.