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

Error “Guest users are not permitted to perform this operation” while creating chatter post in flow

PROBLEM DEFINITION This error takes place when flow runs in the context of a Guest User – like Record is being created from public site or public webhook etc. SOLUTION This happens because Guest User is not allowed to create chatter post i.e. Feed Post. There are possible below approaches: 1) Using Platform Event : Guest user …

Error “Guest users are not permitted to perform this operation” while creating chatter post in flow Read More »