Customizing Information Content and Access > Adding Properties and Fields on Assets, Lines, and Sites
Adding Properties and Fields on Assets, Lines, and Sites
Additional properties and fields, such as Customer and Group, can be added on assets, lines, and sites in the ThingWorx Apps user interface by customizing the appropriate mashups.
Adding Properties and Fields to the Asset Advisor
To display additional properties and fields, such as Customer and Group, on the asset detail page in Asset Advisor, complete the following steps:
1. Modify the Thing Template used for your assets, so that the assets have the necessary properties, such as customerName and group.
2. Edit the PTC.SCA.SCO.AssetMonitor.C_AssetDetailContainerMashup_[ReleaseVersion] mashup. For the layout containing the PTC.SCA.SCO.AssetMonitor.C_AssetSummaryMashup_[ReleaseVersion], increase the HeaderHeight to allow more space for the property table to display additional properties.
* 
When viewing or editing mashups that are provided with ThingWorx Apps, click No if presented with a message asking if you want to replace deprecated widgets with new widgets.
3. In the PTC.Factory.C_LaunchPointConfigurationThing_[ReleaseVersion], under Configuration:
Edit the AssetDetailContainerMashup entry to point to PTC.SCA.SCO.AssetMonitor.C_AssetDetailContainerMashup_[ReleaseVersion].
In the EquipmentUserInterfaceSettings configuration table, edit the AssetDetailContainerMashup entry for the Asset equipment type to point to PTC.SCA.SCO.AssetMonitor.C_AssetDetailContainerMashup_[ReleaseVersion].
4. On the PTC.SCA.SCO.AssetMonitor.AssetDetail.AssetDetailServiceController Thing, override the GetIdentityInfo service, using the following code as an example:
var asset = Things[assetId];
var result = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape({dataShapeName:"PTC.SCA.SCO.AssetMonitor.AssetList.AssetIdentityDataShape"});
if (asset !== null) {
var newEntry = new Object();
newEntry.name = assetId;
newEntry.displayName = asset.displayName;
newEntry.image = asset.assetImage;
if(asset.assetImage !== null){
newEntry.customClass = "";
}
else{
newEntry.customClass = "defaultImage";
}
var assetAttributes = me.GetAssetAttributes({
assetId: assetId /* THINGNAME */
});
newEntry.attributes = assetAttributes;

var newAttributeEntry = new Object();
newAttributeEntry.name = "Customer:";
newAttributeEntry.baseType = "STRING";
newAttributeEntry.value = asset.customerName;
newEntry.attributes.AddRow(newAttributeEntry);

newAttributeEntry = new Object();
newAttributeEntry.name = "Group:";
newAttributeEntry.baseType = "STRING";
newAttributeEntry.value = asset.group;
newEntry.attributes.AddRow(newAttributeEntry);

result.AddRow(newEntry);
}
Adding Properties and Fields to the General Information Page for Equipment
To display additional properties and fields to the General Information page in Configuration and Setup > Equipment, complete the following steps:
1. Duplicate the mashup to override:
For an asset: PTC.Factory.ManufacturingElementGeneralInfo
For a line: PTC.SCA.SCO.LineGeneralInfo
For a site: PTC.Factory.SiteGeneralInfo
2. Update the duplicate mashup as necessary, and save it with a new name.
3. Open the PTC.SCA.SCO.UIProvider Thing.
4. Under Services, click Override service icon to override the GetResourceConfigurationView service.
5. In the script pane, add content similar to the following. Where mashupName is set, replace the default value with the name of your customized duplicate mashup, as appropriate.
var isSite = Resources["PTC.Factory.CommonUtilities"].isSite(
{ thingId: displayId }
);
var isLine = Resources["PTC.Factory.CommonUtilities"].IsLine(
{ thingId: displayId }
);
var isAsset = Resources["PTC.Factory.CommonUtilities"].IsAsset(
{ thingId: displayId }
);
var mashupName = "PTC.Factory.ManufacturingElementGeneralInfo";
if (isSite)
{ mashupName = "PTC.Factory.SiteGeneralInfo"; }
else if (isLine)
{ mashupName = "PTC.SCA.SCO.LineGeneralInfo"; }
else if (isAsset)
{ mashupName = "PTC.Factory.ManufacturingElementGeneralInfo"; }
var result = Resources["InfoTableFunctions"].CreateInfoTable(
{ infoTableName: "infoTable" }
);
var newEntry = new Object();
result.AddField(
{name:"mashup",baseType:"STRING"}
);
result.AddRow(
{mashup:mashupName}
);
6. Click Done to save the overridden service.
7. Click Save to save the PTC.SCA.SCO.UIProvider Thing.
Was this helpful?