Deploy a Configuration Component for a Platform-Event Trigger to Override the Automated Process User

REQUIREMENT I am trying to override the Automated Process user with another user for a platform event. SOLUTION There is a solution is Salesforce, Salesforce documentation says: In accordance with the second article, we can try to accomplish the goal by: In this example, I am gonna explain the second approach, the first approach is …

Deploy a Configuration Component for a Platform-Event Trigger to Override the Automated Process User Read More »

Understand the error – System.QueryException: List has no rows for assignment to SObject

Description This issue you may encounter in apex class if you have query like this: The following query is not returning any number of records: Lead l = [SELECT Id FROM Lead WHERE Id = : recordId]; The error “List has no rows for assignment to SObject” occurs when query doesn’t return any rows. Possible Reason …

Understand the error – System.QueryException: List has no rows for assignment to SObject Read More »

Delete Debug Log In Salesforce Programmatically

Requirement To delete debug logs programmatically in Salesforce, you can use the Salesforce Tooling API as simple Apex DML is not supported on this. Specifically, the ApexLog object represents the debug logs, and you can delete them by querying this object and then using the API to delete the logs. Apex Code