You need to get / set ExtendedDetails values ββwith .Value .
var extendedDetail = contact.ExtendedDetails[fieldName].Value; if (extendedDetail == null) { contact.ExtendedDetails[fieldName].Value = "VALUE" }
For reference, please take a look at the documentation ".NET Auditor API" (chm) and check the "ExtendedDetail" class for some examples.
UPDATE: I have not seen the script when ExtendedDetails will be null. I checked the following minimum data to create a contact and then get the extended data. When you create a contact, you need to have IDENTIFICATION_KEY and IDENTIFICATION_SOURCE , which are required and are part of ExtendedDetails , so you should never run this script.
Could you post a code on how you create a contact?
Ram g source share