system.mes.location.deleteLocation
Description
Deletes a Locations record by its ID or path. This cannot delete a location with references to it.
Syntax
system.mes.location.deleteLocation(idOrPath)
Parameters
Parameter | Type | Description |
---|---|---|
idOrPath | String | The ID or path of the location to delete. |
Returns
If successful, an ApiResponse Object is returned with the success bool set True. If unsuccessful, an InUseException, IllegalArgumentException or ConstraintViolationException is thrown. If the location that's being deleted has a reference, an ApiResponse Object is returned with details about the encountered error.
Name | Type | Description |
---|---|---|
success | Boolean | Indicates if the delete was successful. |
message | String | The reason why the deletion was successful or unsuccessful. |
data | String | The data associated with the deletion. |
error | String | The errors associated with the deletion. |
Code Examples
# Delete a location by ID or path
system.mes.location.deleteLocation('DairyCo')