Timeline for System.NullPointerException: Attempt to de-reference a null object on trigger
Current License: CC BY-SA 3.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Apr 16, 2014 at 8:39 | comment | added | Sven | can you post separate question for that with error msg? | |
| Apr 16, 2014 at 5:10 | comment | added | Sven | is old declared as instance variable? | |
| Apr 16, 2014 at 5:01 | comment | added | user4644 | Hi Sven- I used the below lines in constructor only ------ public PFE_PDFExport_OrderDetails() { if(ApexPages.currentPage().getParameters().get('Id') != null) { oId = ApexPages.currentPage().getParameters().get('Id'); System.debug('**** ORDER ID **** '+oId); and getting error on - " oId = ApexPages.currentPage().getParameters().get('Id'); " | |
| Apr 16, 2014 at 4:46 | comment | added | Sven | You can change your approach. Just get the id in the constructor and pass that id to your method so its behavior remains same in both cases ( i.e. called from trigger or from vf page) | |
| Apr 16, 2014 at 4:36 | comment | added | user4644 | hi, corrceted that. Now I am getting the same error on ----if(ApexPages.currentPage().getParameters().get('Id') != null) | |
| Apr 16, 2014 at 4:31 | history | answered | Sven | CC BY-SA 3.0 |