You need to sign in to do that
Don't have an account?
getcontent is giving me a null pointer exception
I have the following trigger that simply calls a function in a class that gets a pdf blob.
trigger updOpportSendEmail on Opportunity (after insert, before update) { EditOpp.saveoppnew(trigger.new[0].ID); }
@future public static void SaveOppNew(String ID){ Opportunity OppObj = [select ID,StageName,AccountID from Opportunity where ID=:ID limit 1]; system.debug('*****'+OppObj.ID);
PageReference pdf = Page.Invoice_Email; pdf.getParameters().put('id',OppObj.ID); system.debug('*****before blob'); Blob pdfBlob = pdf.getContent(); system.debug('*****after blob');
}
The Id is getting pulled correctly and if I manually go the the Invoice_Email page for that opportunity everything works fine. Does anyone have any idea why pdf.getContent() is giving me the following exception?
System.VisualforceException: java.lang.NullPointerException
--Greg
Just wondering how this situation was resolved?
I'm having the same issue...
The manual states "getContent cannot be used in triggers"
Does this include a method from a class being called via a trigger?