---
title: synchronize()
framework: opendirectory
role: symbol
role_heading: Instance Method
path: opendirectory/odrecord/synchronize()
---

# synchronize()

Synchronizes the record from the directory to get current data and commit changes.

## Declaration

```swift
func synchronize() throws
```

## Discussion

Discussion This method only fetches those attributes that have been fetched before. note: In Swift, this method returns Void and is marked with the throws keyword to indicate that it throws an error in cases of failure. You call this method in a try expression and handle any errors in the catch clauses of a do statement, as described in Error Handling in The Swift Programming Language and About Imported Cocoa Error Parameters.

## See Also

### Managing Record Attributes

- [addValue(_:toAttribute:)](opendirectory/odrecord/addvalue(_:toattribute:).md)
- [recordDetails(forAttributes:)](opendirectory/odrecord/recorddetails(forattributes:).md)
- [recordName](opendirectory/odrecord/recordname.md)
- [recordType](opendirectory/odrecord/recordtype.md)
- [removeValues(forAttribute:)](opendirectory/odrecord/removevalues(forattribute:).md)
- [removeValue(_:fromAttribute:)](opendirectory/odrecord/removevalue(_:fromattribute:).md)
- [setValue(_:forAttribute:)](opendirectory/odrecord/setvalue(_:forattribute:).md)
- [values(forAttribute:)](opendirectory/odrecord/values(forattribute:).md)
