entitySave

Saves or updates data of the entity and all related entities to the database.

entitySave(entity [, forceInsert]) → returns void

entitySave Argument Reference

entity variableName
Required

Name of the entity that must be saved in the database.

forceInsert boolean
Default: false

If true, then ColdFusion always tries to insert the entity as a new record.

Examples sample code invoking the entitySave function

Use entitySave to save a newly created entity.

var company = entityNew("Company");
company.setName(form.companyName);
company.setIndustry(form.industry);
company.setEmployees(form.employeeCount);
company.setWebsite(form.companyWebsite);
entitySave(company);

Fork me on GitHub