Failed to execute the [include] macro. Cause: [Current user [null] doesn't have view rights on document [xwiki:More-Products.RemedyForce.BMC-Remedyforce.remforce201503.Space-announcements.WebHome]]. Click on this message for details.
Deleting assets
If you have assets that are no longer being used, or you are discarding them, such as old hardware, you can delete these assets to ensure that you have an accurate representation of the assets in your IT environment. When you delete an asset from the database, all relationships associated with that asset are also deleted.
To delete an asset
- Click the Remedyforce CMDB tab.
In the left navigation pane of the Remedyforce CMDB tab list view page, select the class whose assets you want to delete.
- In the right pane of the Remedyforce CMDB tab list view page, select the asset that you want to delete.
You can use the Search box to search for assets based on specific keywords. You can also search for assets that contain wildcard characters (such as /, #, $, %, -, and so on). If you select a class in the left navigation pane, only the assets of that class are searched. To search all classes, select the Base Element class in the left navigation pane. You can search for an asset by using data in the Instance ID, Instance Name, Description, Class Name, Asset #, Token ID, and Serial # columns.
Alternatively, you can use search Filterto perform a more precise search that can be based on multiple criteria. For more information, see Overview-of-the-Remedyforce-CMDB-tab.
Click Delete.
- In the confirmation dialog box, click Yes.
You can delete one or more assets from the Base Element object of the CMDB by using Salesforce Object Query Language (SOQL) query, Salesforce page layout, the data loader, or the Pentaho Data Integration tool. When you delete an asset, the asset relationships, client links, and tasks links are also deleted.
Deleting a CI and asset record
When both CI and IT asset management are enabled, if you select a CI/Asset instance and click Delete, the following delete options are available based on your CMDB user permissions and the tab that you have selected on the left navigation pane of the Remedyforce CMDB tab:
Tab on the left navigation pane | Available delete options |
---|---|
CI |
|
Asset |
|
All |
|
To delete assets by using the Developer Console
- Navigate to the Developer Console.
- Click the text box next to the Execute button.
- Enter a script to delete the assets. BMC recommends that the batch size for the query should be 50.
- Example: To delete assets from a specific asset class, use the following script:
Delete [Select ID From BMCServiceDesk__BMC_BaseElement__c where BMCServiceDesk__class__c ='BMC_Tablet' Limit 50] - Example: To delete assets that are marked to be deleted from a specific asset class, use the following script:
Delete [Select ID From BMCServiceDesk__BMC_BaseElement__c where BMCServiceDesk__class__c ='BMC_Tablet' AND BMCServiceDesk__MarkAsDeleted__c =TRUE Limit 50] - Example: To permanently delete the records from a CI, asset, or CI and Asset class, use the following script:List<BMCServiceDesk__BMC_BaseElement__c> BEList = [select Id from BMCServiceDesk__BMC_BaseElement__c where BMCServiceDesk__class__c = 'BMC_IPEndpoint' Limit 50];
delete BEList; Example: To delete records only from a Rule Based Asset class, and not from the CI class on which that Rule Based Asset class is based:
List< BMCServiceDesk__BMC_BaseElement__c> BEList = [select Id, BMCServiceDesk__DeleteStatusCode__c from BMCServiceDesk__BMC_BaseElement__c where BMCServiceDesk__FKAssetRuleClass__r. BMCServiceDesk__ClassName__c = 'BMC_Desktop'/'BMC_Router' Limit 50];
for(BMCServiceDesk__BMC_BaseElement__c inst : BEList){
inst. BMCServiceDesk__DeleteStatusCode__c = 1;
} update BEList;Example: To delete only assets from a CI and Asset class:
List< BMCServiceDesk__BMC_BaseElement__c> BEList = [select Id, BMCServiceDesk__DeleteStatusCode__c from BMCServiceDesk__BMC_BaseElement__c where BMCServiceDesk__FKAssetRuleClass__r. BMCServiceDesk__ClassName__c = 'BMC_Monitor' Limit 50];
for(BMCServiceDesk__BMC_BaseElement__c inst : BEList){
inst. BMCServiceDesk__DeleteStatusCode__c = 1;
} update BEList;
- Example: To delete assets from a specific asset class, use the following script:
- Click Execute.