Method: Frodo::Concerns::API#destroy!

Defined in:
lib/frodo/concerns/api.rb

#destroy!(entity_set, id) ⇒ Object

Public: Delete a record.

entity_set - The set the entity belongs to id - The Dynamics primary key ID of the record.

Examples

# Delete the lead with id  "073ca9c8-2a41-e911-a81d-000d3a1d5a0b"
client.destroy!('leads',  "073ca9c8-2a41-e911-a81d-000d3a1d5a0b")

Returns true of the entity was successfully deleted. Raises an exception if an error is returned from Dynamics.



192
193
194
195
196
197
# File 'lib/frodo/concerns/api.rb', line 192

def destroy!(entity_set, id)
  query = service[entity_set].query
  url_chunk = query.find(id).to_s
  api_delete url_chunk
  true
end