I'm trying to set and retrieve custom field values on an appointment I'm creating in code.

When I create the appointment here is the field code:

string parent_id = "ABC123";

groupwiseAccount.FieldDefinitions.Add("ParentID", GroupwareTypeLibrary.FieldTypeConstants.egwString) ;

appt.Fields.Add("ParentID", GroupwareTypeLibrary.FieldTypeConstants.egwString, parent_id);

When I try to retrieve the value placed in the ParentID field I use this code:

string parent_id = appt.Fields.Item("ParentID", GroupwareTypeLibrary.FieldTypeConstants.egwString) .ToString();

The problem is I'm not getting back what I put in...can anyone give me some direction of what I am doing wrong?