Skip to main content

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

ParameterTypeDescription
idOrPathStringThe 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.

NameTypeDescription
successBooleanIndicates if the delete was successful.
messageStringThe reason why the deletion was successful or unsuccessful.
dataStringThe data associated with the deletion.
errorStringThe errors associated with the deletion.

Code Examples

# Delete a location by ID or path
system.mes.location.deleteLocation('DairyCo')