When upserting the fields of Attachment such as Name, upsert works while upserting body like:
SObject upsertDoc1 = new SObject("Attachment"); upsertDoc1.setField("Name", "dummyattach_gloria.txt"); upsertDoc1.setField("ID", "00P1a000000FrAAACA0"); upsertDoc1.setField("Body", "aHR0cDovL3N0bGFiLmFkb2JlLmNvbS93aWtpL2ltYWdlcy9kL2QzL1Rlc3QucGRm");
The upsert fails with the error:
The Upsert failed because: Body: value not of required type: aHR0cDovL3N0bGFiLmFkb2JlLmNvbS93aWtpL2ltYWdlcy9kL2QzL1Rlc3QucGRm
This is a Base64 field. How do I deal with this kind of update? Additionally, should I also be updating the BodyLength or will it be handled automatically?