Skip to content

Manipulating Modules

icaton edited this page Apr 27, 2011 · 19 revisions

Get available modules

The get_available_modules function retrieves the list of modules available to the current user logged into the system. You can take the result from the function call and view every modules in the field. You can view the get_available_module function here: get_available_modules()

Let's take our session object and make a call to get_available_modules and store them in a module variable.

modules = session.get_available_modules()

Outputting this will give you the entire list of modules as we stated above. It will look something similar to this:

Get module fields

The get_module_fields function is a more specified way of accessing module information, except now you specify a module and a specify a field in that module. This method allows us to have more precise information about the users database. The get_module_fields function is here: get_module_fields()

The function call looks like this: get_module_fields(self, module_name, fields = [])

As you can see, the function call takes two parameters, a module and field. In the module parameter we specify a module name and the fields is a specific field in the given module. First we will look at an individual module. We can do so by inputting a module parameter but not a field parameter.

module = 'Accounts'
module_info = session.get_module_fields(module)

The information stored in module_info will contain all of the fields that are in the 'Accounts' module. This is important, as it will help show us what fields exist inside each module.

Now that we have a list of all the fields in the Accounts module, we can look at information in one of these fields.

Clone this wiki locally