DataImportService.getDictionaries

Syntax

getDictionaries (isCalendar, parentIfNotCalendar)

Parameters

isCalendar. Specifies whether to get table or calendar dictionaries. If this parameter is set to True the method returns calendar dictionaries, otherwise it returns table dictionaries.

parentIfNotCalendar. A table dictionary parent is a JSON object that represents Od structure. It is relevant if the isCalendar parameter is set to False.

Description

The getDictionaries method returns repository dictionaries.

Example

To execute the example, in the HEAD tag of the HTML page add links to the following JS and CSS files:

In the SCRIPT tag add the following script:

    //repository connection
    var mb = new PP.Mb.Metabase(
	{
	    PPServiceUrl: "PPService.axd?action=proxy",
	    Id: "Warehouse",
	    UserCreds: { UserName: "sa", Password: "Qwerty1" }
	});
    mb.open();
    //service for working with import object
    var dataImportService = new PP.Mb.DataImportService({ Metabase: mb });
    dataImportService.GetObjectsCompleted.add(onObjectsLoaded);
    // request objects:
    //all calendar dictionaries
    dataImportService.getDictionaries(true);
    //all folders
    dataImportService.getFolders();
    //all MDM dictionaries
    dataImportService.getRepositories();
    function onObjectsLoaded(sender, args)
     {
         var objs = args.Objects;
         for (var i = 0; i < objs.length; i++)
          {
          // names and keys of obtained objects are displayed in the browser console
              console.log(objs[i].n + (" ")+ objs[i].k)
          }
     }

After executing the example the method returns all calendar dictionaries, folders and MDM repositories of the selected repository. Their names and keys are displayed to the browser console.

See also:

DataImportService