Skip to contents

Updates a specific field value for a record and logs the change in the change log file.

Usage

update_record(data, log, record_id, field, new_value, reason)

Arguments

data

A data frame containing the records to update

log

A data frame containing the change log

record_id

The ID of the record to update (embrace_id)

field

The field name to update

new_value

The new value to set

reason

The reason for making the change

Value

An updated change log data frame with the new entry

Examples

if (FALSE) { # \dontrun{
data <- data.frame(embrace_id = c("001", "002"), value = c(10, 20))
log <- data.frame(ChangeID = integer(), RecordID = character(),
                 Field = character(), OldValue = character(),
                 NewValue = character(), ChangeDate = as.Date(character()),
                 Reason = character())
log <- update_record(data, log, "001", "value", 15, "Correction")
} # }