You need to sign in to do that
Don't have an account?
vijayabhaskarareddy
attempt to de-reference a null object in salesforce
i have been getting above error when i execute this code in develooper console
List<orderItem> membs1 = [SELECT id FROM OrderItem WHERE orderid ='8017F000000CfJZ']; list <id> opids; for( orderItem OI : membs1) { opids.add(OI.id); } system.debug('orde product ids r =='+ opids);
Your List is not iniliatlized !.
All Answers
Hi vijayabhaskarareddy,
Try Initializing the List before. It is working fine in my Org.
Screenshot :
I have no such record with that Id, that's why it is showing null.
Hope it Helps you. Please mark this as solved so that it gets removed from the unanswered queue which results in helping others who are encountering a similar issue.
Regards ,
Suraj
Your List is not iniliatlized !.