Add an adding record and editing record functional