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 ExamplesDescriptionParameters: 
 | Command LineConstraintsControllersDatabase MappingDomain ClassesPlug-insServicesServlet API |