You need to sign in to do that
Don't have an account?
balaji rao
please help on the above error
System.DmlException: Insert failed. First exception on row 0; first erro
System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, COH_BP_FeedItemTrigger: execution of BeforeInsert caused by: System.NullPointerException: Attempt to de-reference a null object Class.COH_BP_FeedItemHelper.processNewFeedItems: line 354, column 1 Trigger.COH_BP_FeedItemTrigger: line 15, column 1: []
please help on the above error
Greetings to you!
According to Salesforce knowledge article (https://help.salesforce.com/articleView?id=000063739&type=1):
This error is caused by a line of code that is trying to use an object that has not been instantiated, or an object's attribute that has not been initialized.
NOTE: If the field Site was left empty, it will generate the error message as well.
The solution is to make sure the Object and/or the Attribute to be used is not null. In this example, the code needs to be modified as follows:
Exception handling routine:
For more information on handling exceptions, check the Apex Language Reference, under "Using Exception Methods," or "Using Exception Variables. (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_exception_methods.htm)"
For more information on initializing variables, look under Chapter 2, "Language Constructs", in the topics "Variables", and "Case Sensitivity (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_datatypes_variables_intro.htm)".
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas