You need to sign in to do that
Don't have an account?
Shravya Rama 9
Throwing error on current record when new record insertion is failed
Hallo all,
Is it possible to stop inserting current record when the new record insertion from the apex trigger fails. It should also throw an error on UI "The current record failed to created new records".
Is it possible to stop inserting current record when the new record insertion from the apex trigger fails. It should also throw an error on UI "The current record failed to created new records".
Try using sobject add error method. Something like this might be in order:
you can read more on this as well as other similar functions here (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_sobject.htm).
Hope this helps!
AM
Apexpages.addMessage(new Apexpages.message(ApexPages.Severity.Error,'Not possible')); with <apex:pageMessages> tag. Even this is not working.