| GET,PUT,POST,DELETE | /{Workspace}/InventoryItemTemplate |
|---|
export enum CustomFieldDataType
{
Text = 'Text',
Number = 'Number',
Decimal = 'Decimal',
Money = 'Money',
PhoneNumber = 'PhoneNumber',
Ssn = 'Ssn',
List = 'List',
Date = 'Date',
File = 'File',
Barcode = 'Barcode',
GPS = 'GPS',
Photo = 'Photo',
Spacer = 'Spacer',
Separator = 'Separator',
AutoNumber = 'AutoNumber',
TextArea = 'TextArea',
Contact = 'Contact',
User = 'User',
Asset = 'Asset',
Checkbox = 'Checkbox',
CoreAssetList = 'CoreAssetList',
CoreTaskList = 'CoreTaskList',
CoreParentTask = 'CoreParentTask',
CoreContactList = 'CoreContactList',
ComboBox = 'ComboBox',
DateTime = 'DateTime',
Time = 'Time',
Location = 'Location',
CoreLocation = 'CoreLocation',
Label = 'Label',
EventLog = 'EventLog',
Address = 'Address',
Catalog = 'Catalog',
CoreTeamList = 'CoreTeamList',
Segment = 'Segment',
CoreTimeSeries = 'CoreTimeSeries',
TimeSeries = 'TimeSeries',
Command = 'Command',
AutoNumberNumeric = 'AutoNumberNumeric',
CatalogList = 'CatalogList',
CatalogComboBox = 'CatalogComboBox',
DateRange = 'DateRange',
DocumentGrid = 'DocumentGrid',
ReportLink = 'ReportLink',
Hyperlink = 'Hyperlink',
PercentComplete = 'PercentComplete',
Chart = 'Chart',
Range = 'Range',
ExternalId = 'ExternalId',
AssetCatalog = 'AssetCatalog',
Inventory = 'Inventory',
CoreTaskLaborItemTypes = 'CoreTaskLaborItemTypes',
CoreTaskLaborItems = 'CoreTaskLaborItems',
ObjectList = 'ObjectList',
CoreTimeZone = 'CoreTimeZone',
}
export class CustomField
{
public Key: string;
public Label: string;
public IsActive: boolean;
public IsReadOnly: boolean;
public IsHidden: boolean;
public IsMandatory: boolean;
public DisplayOnMap: boolean;
public CustomFieldDataType: CustomFieldDataType;
public Values: string;
public Prompt: string;
public Default: string;
public DefaultAutoUpdate: boolean;
public RequiredIf: string;
public Hidden: string[];
public ReadOnly: string[];
public ControlArgs: { [index: string]: Object; };
public IndexSlot: string;
public Index: string;
public constructor(init?: Partial<CustomField>) { (Object as any).assign(this, init); }
}
export class InventoryItemTemplate
{
public ObjectId: string;
public Workspace: string;
public Name: string;
public CustomFields: CustomField[];
public constructor(init?: Partial<InventoryItemTemplate>) { (Object as any).assign(this, init); }
}
TypeScript InventoryItemTemplate DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /{Workspace}/InventoryItemTemplate HTTP/1.1
Host: dev.fieldsquared.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
ObjectId: String,
Workspace: String,
Name: String,
CustomFields:
[
{
Key: String,
Label: String,
IsActive: False,
IsReadOnly: False,
IsHidden: False,
IsMandatory: False,
DisplayOnMap: False,
CustomFieldDataType: Text,
Values: String,
Prompt: String,
Default: String,
DefaultAutoUpdate: False,
RequiredIf: String,
Hidden:
[
String
],
ReadOnly:
[
String
],
ControlArgs:
{
String: {}
},
IndexSlot: String,
Index: String
}
]
}