Click or drag to resize
LegacyTelogisServiceListUnitTags Method
Print this page
Gets all the tags for a given unit.

Namespace: Telogis.API
 
Syntax
public Tag[] ListUnitTags(
	long unitId
)

Parameters

unitId
Type: SystemInt64
ID of the Unit

Return Value

Type: Tag
An array of Tag objects associated with the specified Unit .
Remarks
You should use tags to group and sort your units. For example, you would use the tag 'refrigerated' to mark units (vehicles) that are refrigerated.
Examples
C#
// get *all* the units (use ListUnits() if you have 
// a large number of units)
Unit[] units = myService.FindUnits(null, null);
foreach (Unit u in units)
{
    Console.WriteLine("UNIT[{0}]", u.Name);
    // list all the tags for our current unit
    Tag[] tags = myService.ListUnitTags(u.ID);
    foreach (Tag t in tags)
    {
        Console.WriteLine("  TAG[{0}]", t.Name);
    }
    Console.WriteLine();
}
See Also