You need to sign in to do that
Don't have an account?
Anthony Piaia
after insert, after update triggers
Hello, I need some help with a couple triggers i'm having issues with. I am somewhat new to triggers and i created and After update trigger that inserts a list when an opportunity is updated if the list = 0. The problem i'm having is that another trigger might be causing my trigger some issues. We have a database feeding into salesforce using a boomi process and accounts are not being updated or failing because of the 2 triggers. Below is the error:
SF_ERROR: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY
OBJ: Applicant__c - ApplicantDataWriting: execution of AfterUpdate
caused by: System.DmlException: Update failed. First exception on row 0 with id 006F000000JBTpEIAX; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, applicationchecklistUpdate: execution of AfterUpdate
caused by: System.DmlException: Insert failed. First exception on row 0 with id a0sF0000003fQgQIAU; first error: INVALID_FIELD_FOR_INSERT_UPDATE, cannot specify Id in an insert call: [Id]
Trigger.applicationchecklistUpdate: line 202, column 1: []
Trigger.ApplicantDataWriting: line 266, column 1
My trigger is an after update trigger which inserts a list an an object if it's = to 0 and the other triger is an after insert, after update trigger which converts leads to opportunities, updates accounts, opportunities and create new opportunities based on a boomi process we have which feeds from our database to boomi.
I did not have room to post the code but i can after i sumit the question.
Any help is appreciated.
SF_ERROR: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY
OBJ: Applicant__c - ApplicantDataWriting: execution of AfterUpdate
caused by: System.DmlException: Update failed. First exception on row 0 with id 006F000000JBTpEIAX; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, applicationchecklistUpdate: execution of AfterUpdate
caused by: System.DmlException: Insert failed. First exception on row 0 with id a0sF0000003fQgQIAU; first error: INVALID_FIELD_FOR_INSERT_UPDATE, cannot specify Id in an insert call: [Id]
Trigger.applicationchecklistUpdate: line 202, column 1: []
Trigger.ApplicantDataWriting: line 266, column 1
My trigger is an after update trigger which inserts a list an an object if it's = to 0 and the other triger is an after insert, after update trigger which converts leads to opportunities, updates accounts, opportunities and create new opportunities based on a boomi process we have which feeds from our database to boomi.
I did not have room to post the code but i can after i sumit the question.
Any help is appreciated.
Anthony Piaia
Anthony Piaia
Crystal Rochlitz 4
I wouldn't even know where to beigin debugging this hot mess. (No offense) First thing I notice is that there are no methods and no debug statements. These things alone will help IMMENSELY when trying to determine where your problem lies. I also noticed that there IDs being stored in lists as strings and queries running against these lists. That may be a problem. Speaking of IDs, hard coding in IDs (RecordIds, OwnerIds, etc.) is no bueno. IDs vary from sandbox to sandbox and then again in production. So, even if you got this working now, no guarantee that it will continue to stay working in the future. Run a query, store the result in a variable, pass the variable. Split some of these procedures into different methods with many, many debug statements to control and monitor the flow, and do the suggestions above then once you have a better idea of where the problem is update here for more help. GL :)
Crystal Rochlitz 4
Ok, just to clarify...no methods in triggers (I forget these things). You could create classes for each trigger logic, then call the classes from a handler. But, I digress...