I am trying to add an additional field not contained in a template using SDK 10.2.
The FieldValueCollection.Add() method's isIndependent parameter seems to be ignored.
Even if I specify true for this parameter, I still receive the following error:
"Could not find the field specified, or the field is not part of the specified template. [9016]"
Code example:
using (DocumentInfo docInfo = new DocumentInfo(laserFicheSession)) {
docInfo.Create(lfDocumentName, laserFicheVolume, EntryNameOption.AutoRename);
FieldValueCollection fieldValues = new FieldValueCollection();
fieldValues.Add("First Name", lfTemplateFields.FirstName); // template field
fieldValues.Add("Last Name", lfTemplateFields.LastName); // template field
if (!String.IsNullOrEmpty(lfTemplateFields.TransactionNumber)) {
// NOT template field
fieldValues.Add("Transaction Number", lfTemplateFields.TransactionNumber, true);
}
docInfo.SetFieldValues(fieldValues);
docInfo.SetTemplate("Student");
docInfo.Save(); // error on this line if NOT template field is present
}
Thanks for any insights,
Matthew