'Bookmark the current record for de-duplication
@param r: the S3Request
@param attr: the controller parameters for the request'

def mark(self, r, **attr):

    s3 = current.session.s3
    DEDUPLICATE = self.DEDUPLICATE
    if (DEDUPLICATE not in s3):
        bookmarks = s3[DEDUPLICATE] = Storage()
    else:
        bookmarks = s3[DEDUPLICATE]
    record_id = str(self.record_id)
    if record_id:
        tablename = self.tablename
        if (tablename not in bookmarks):
            records = bookmarks[tablename] = []
        else:
            records = bookmarks[tablename]
        if (record_id not in records):
            records.append(record_id)
    else:
        return self.duplicates(r, **attr)
    return current.xml.json_message()
