entitySave

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

entitySave(entity [, forceInsert]) → returns void

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);

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub