def accountId = ...
if (Account.exists(accountId)) {
    // do something
}
exists
Purpose
Checks whether an instance exists for the specified id
Examples
Description
Parameters:
- 
id- The id of the object 
| 
             
                (Quick Reference)
                
                 
        existsPurposeChecks whether an instance exists for the specified id Examples
DescriptionParameters: 
  | 
        
            APICommand LineConstraintsControllersDatabase MappingDomain ClassesPlug-insServlet APITag LibrariesTags - GSPVersions |