You can get all accounts in such way:
wialon.core.Session.getInstance().loadLibrary("resourceAccounts");
var searchSpec = {
itemsType: "avl_resource", // type of search item
propName: "sys_name", // field of search item
propValueMask: "*", // value mask for field
sortType: "sys_name"
};
// flags for accessing information about account
var dataFlags = wialon.item.Item.dataFlag.base|wialon.item.Item.dataFlag.billingProps;
wialon.core.Session.getInstance().searchItems(searchSpec, true, dataFlags, 0, 0, function(code, data) {
if (!code) {
for (var i = 0; i < data.items.length; i++)
if(data.items[i].getAccountId() == data.items[i].getId()) // if resource is account
alert(items[i].getName());
}
});
Development Department
Gurtam