Hi Tom,
If you set the name and value to "primaryEmail" you will get true stored in the database. Here's a sample using the DataRecord class from the tools.jar:
dataRecord.setName("contactEmailAddress");
dataRecord.setAction(org.aspcfs.apps.transfer.DataRecord.INSERT);
dataRecord.addField("contactId", 1);
dataRecord.addField("type", 2);
dataRecord.addField("email", "test@example.com");
dataRecord.addField("enteredBy", 1);
dataRecord.addField("modifiedBy",1);
dataRecord.addField("primaryEmail","primaryEmail");
connection.save(dataRecord);
As you thought, this is because of the way the XML HTTP API works. Incoming requests to the ProcessPacket class are read and the elements are mapped to their base class, in this case, ContactEmailAddress. Each child element is then populated in the object through the setter methods. The unexpected behavior is caused from an overloaded setPrimaryEmail method that accepts a String. This method breaks convention and sets the field to true only if the String is "primaryEmail."
- Lorraine