models/asset
Parameters
Parameter |
Type |
Attributes |
Description |
---|---|---|---|
mode |
Number, Boolean |
Required |
Pass an asset id to load a record, true to create a record, or false to validate a record configuration. |
item |
Number |
Required |
Item record the asset was generated from. |
serial |
String |
Required |
Unique serial for the asset |
Members
uniqueFormula
Type |
Description |
---|---|
Array |
Formula to check for duplicate assets |
Default
{}
uniqueTemplate
Type |
Description |
---|---|
Array |
Template to compare objects to search results |
Default
{}
customers
Type |
Description |
---|---|
Object |
Customers available to be serviced by the current Asset. The current record model and the selected Asset model is in scope. |
Default
{
"customers": {
"array": true,
"customer": {
"all": true,
"record": "customer",
"filters": [
"internalid",
"anyof",
"${ asset.customer || 0 }"
]
}
}
}
map
Type |
Description |
---|---|
Object |
Field map |
Properties
Property |
Type |
Description |
---|---|---|
name |
String |
Name of the Asset |
autoname |
String |
Auto generated name for the Asset. When this has a value, the Name is populated from this attribute. Overwrite this to disable autonaming or change the naming formula. |
parent |
Number |
Auto generated name for the Asset. When this has a value, the Name is populated from this attribute. Overwrite this to disable autonaming or change the naming formula. |
item |
Number |
Item the Asset is an instance of. |
serial |
String |
Serial number of the Asset. |
customer |
Number |
Customer owner of the Asset |
customers |
true, false, * |
Customers that are valid to create records against. Overwrite this to refer to Asset fields. When true all customers are available. When false no customers can be selected. When an id or list or ids, these customers are used. Otherwise differ to customers object. |
addressbook |
String |
Customer address book associated with the Asset. |
addresstext |
String |
Address of the asset. This is sourced from addressbook when present. |
latitude |
String |
Latitude of the asset. This is calculated from the addresstext when present. |
longitude |
String |
Longitude of the asset. This is calculated from the addresstext when present. |
region |
Number |
Region the Asset is in. |
Default
{
"map": {
"name": "name",
"autoname": "formulatext:substr(trim(regexp_replace({custrecord_nx_asset_item}, '^'||{custrecord_nx_asset_item.parent}||' : ')||' '||nvl({custrecord_nx_asset_serial}, nvl(regexp_replace({custrecord_nx_asset_address_text},CHR(13)||CHR(10),' '), {custrecord_nx_asset_address}))), 1, 80)",
"parent": "parent",
"type": "custrecord_nx_asset_type",
"item": "custrecord_nx_asset_item",
"serial": "custrecord_nx_asset_serial",
"customer": "custrecord_nx_asset_customer",
"customers": "formulatext:{custrecord_nx_asset_customer.internalid}",
"transaction": "custrecord_nx_asset_transaction",
"addressbook": "custrecord_nx_asset_address",
"addresstext": "custrecord_nx_asset_address_text",
"latitude": "custrecord_nx_asset_latitude",
"longitude": "custrecord_nx_asset_longitude",
"timezone": "custrecord_nx_asset_time_zone",
"timezoneid": "custrecord_nx_asset_time_zone.custrecord_nx_time_zone_olson|",
"region": "custrecord_nx_asset_region",
"locationchanged": "custrecord_nx_asset_location_update",
"id": "internalid"
}
}
record
Type |
Description |
---|---|
String |
Record type |
Default
{
"record": "customrecord_nx_asset"
}