GetFieldValue behavior in PostConversion script when field is missing
What does DocumentInfo.GetFieldValue return if the requested field is missing ?
I have a Post Conversion script that attempts to retrieve a field value and store it in a custom field. I have initialized the custom field to a string ('InitializedState').
There are some documents that do not contain the field that the script tries to retrieve. In this case, I have some logic to deal with the missing field. However, the custom field still contains 'InitializedState' when the field is missing. Therefore, it seems that the conversion script exits when the field does not exist before I can execute additional logic.
Get/SetFieldValue should really be renamed Get/SetMetaDataValue :)
The "field" DocumentInfo.GetFieldValue("somemeta") is not the field "somemeta" but the metadata "somemeta". If you have a field say "somefield" with "somemeta" as it's metadata name then using SetFieldValue("somemeta", "somevalue") will set the field value of "somefield" to "somevalue" , through it's metada "somemeta".