iOS SDK Samples - Notes Operations
Get All Notes
// record is the object of getRecordDelegate
$record.getNotes { ( result ) in
switch result
{
case .success(let notes, let response) :
print ("ResponseJSON : \( response.responseJSON )")
case .failure(let error) :
print ( "Throws exception : \(error)" )
}
}
Get Notes with "recordParam"
var recordParams = ZCRMQuery.getEntityRequestParams
recordParams.page = 3
recordParams.perPage = 25
recordParams.sortBy = "name"
// record is the object of getRecordDelegate
$record.getNotes(withParams: recordParams) { ( result ) in
switch result
{
case .success(let notes, let response) :
print ("ResponseJSON : \( response.responseJSON )")
case .failure(let error) :
print ( "Throws exception : \(error)" )
}
}
Get a Note
// record is the object of getRecordDelegate
$record.getNote( id : 234xxx456) { ( result ) in
switch result
{
case .success(let note, let response) :
print ("ResponseJSON : \( response.responseJSON )")
case .failure(let error) :
print ( "Throws exception : \(error)" )
}
}
Delete a Note
// record is the object of getRecordDelegate
$record.deleteNote( id : 123456789) { ( result ) in
switch result
{
case .success(let response) :
print ("ResponseJSON : \( response.responseJSON )")
case .failure(let error) :
print ( "Throws exception : \(error)" )
}
}
Update Notes
// record is the object of getRecordDelegate()
// note is the object of getNote()
$record.updateNote(note: note){ ( result ) in
switch result
{
case .success(let note, let response) :
print ("ResponseJSON : \( response.responseJSON )")
case .failure(let error) :
print ( "Throws exception : \(error)" )
}
}
Create a Note
// parentRecord is the object of getRecordDelegate
let note : ZCRMNote = parentRecord.newNote(content: "Creating Note", title: "iOS create Note testing")
$parentRecord.addNote(note: note) { ( result ) in
switch result
{
case .success(let note, let response) :
print ("ResponseJSON : \( response.responseJSON )")
case .failure(let error) :
print ( "Throws exception : \(error)" )
}
}