Posts

Showing posts with the label Id

Salesforce Fact #782 | EMPTY_ID in group by

Image
While using GROUP BY in SOQL to find out the count of users corresponding to each role, for the blank role the developername is shown as 'EMPTY_ID'. Attached is the screenshot.

Salesforce Fact #749 | Empty key Id in Salesforce

Image
There is an empty key Id in Salesforce and the id is ' 000000000000000AAA'. This is equivalent to NULL or no-reference to parent record. This can be used in place of NULL while updating records via data loader without enabling the 'insert null values' setting. Reference:  http://www.fishofprey.com/2011/06/salesforce-empty-key-id.html Attached is one screenshot.

Salesforce Fact #6 | Id not needed

Considering the below query returns result, do you think is there any error: Account a = [SELECT Name FROM Account LIMIT 1]; System.debug(a.Id); You might think that a.Id will generate an error as Id field is not fetched in the SOQL query. But the thing is, ID field is implicitly returned in case of SOQL query result. So the above query is interpreted as: Account a = [SELECT Id, Name FROM Account LIMIT 1]; Hence, we need not specify Id field explicitly in the SOQL query unless we are doing some kind of existence check like: List<Account> accList = [SELECT Id FROM Account WHERE Name=<inputname>];