Salesforce Fact #814 | Simplified row returned check on SOQL

With the advent of the new Null Coalescing operator, the row returned check from SOQL has also been simplified.

Previously, if a query is expected to return one row and if it does not return any row we used List collection to avoid the error: 'List has no rows for assignment to SObject'.

But now, with Null Coalescing operator we can check it using the sobject variable only, no need of List collection.

Attached is the screenshot.






Comments

Popular posts from this blog

Salesforce Fact #192 | Call batch apex from flow

Salesforce Fact #457 | Get current user role name in flow