I have a managed package since we cannot see the debug logs in client orgs we are writing them to a dedicated logging object. We have a problem where it is refusing to write anything. In the debug logs it shows that it is trying to write:
16:54:57:302 DML_BEGIN [18]|Op:Insert|Type:GLxero__XeroLog__c|Rows:1
I have checked all of the profile write permissions and field level security and I don't know why it is not writing.
try{
OnlineInvoiceURL = XeroAccountingApi.OnlineInvoiceURL(ExistingInvoiceId);
}catch (exception e){
system.debug('Error getting OnlineURL'+e);
XeroLogger.log('Calling OnlineInvoiceURL function '+e.getStackTraceString(), null );
}
In the logger class
global with sharing class XeroLogger {
global static void log( string e, string XeroId ) {
system.debug('Error logged: '+e);
XeroLog__c log = new XeroLog__c(
summary__c = XeroId,
detail__c = e
);
insert log;
}
}