This project is read-only.

There was an error generating the XML document


I got this error message each time i try to register the Audit plug-in on "Update" message of any entity either on Post or Pre.
The error message is "There was an error generating the XML document.".
for example: i registered the plug-in on Create of Contact with Target image either on Post.
Else the plugin goes smoothly with other messages.
Thanks in advance.


chanjacky wrote Aug 8, 2010 at 9:09 AM

i do a lead's update audit.i through your idea to do,but i still recvice the XML documents error.pls tell your other idea.thanks!!!!

ferolen wrote Sep 27, 2010 at 12:42 AM

I also come across this error.

In my case, the Audit Plugin expects a value (Not Null) on some fields, which we left blank.
A field was Business required field by default (i.e. Incident's Title), but we change the field's requirement level to none. When we create a new record and left this field blank, Audit Plugin will throw "There was an error generating the XML document.".

Hope it helps to fix this cool plugin.


davideison wrote Feb 11, 2011 at 12:09 AM

This is caused by the primary attribute field being null but not allowed to be null.
I don't know exactly how, but it is legitimately possible for an audited record to have a null primary attribute field, which leads to this error in saving the audit entity. Should fix it, default the val to something in case of null:

var val = this.GetValue(context, res.EntityMetadata.PrimaryField);
auditRecord.Properties["custom_primary_attribute"] = val ?? "(blank)";

thai87 wrote May 15, 2012 at 9:00 PM

Are you mapping all attributes in Image?
I solved this issue doing this. I was updating a record, and the mentioned message was returned to me. In my Image, I mapped only the field that I wanted monitor.
After alter the Image, selecting all attributes box, the plugin work fine!

Try this...


wrote Feb 14, 2013 at 2:59 AM