Working with companies in CRMScript
Company (class)
The Company CRMScript class represents the following entities:
- Real-life: a company or organization
- SuperOffice UI: company
- Database table: contact
The company database table is unrelated to the Company CRMScript class. The table should have one row only, containing information about licenses and the owner of the SuperOffice database.
⚠️ Warning
Changing the
company table will make it impossible to sign in for all users. The only fix is to restore the database from backup.Parser variables
Calling toParser() will load the following fields and make them available to templates:
- company.id
- company.name
- company.note
- company.domain
- company.phone
- company.fax
- company.adr
- company.ourContact
- company.primaryContact.id
- company.primaryContact.email
See the connected persons table for a description of ourContact and primaryContact.
Parser p;
Company c;
c.load(2);
c.toParser(p);
printLine(p.getVariable("company.name", 0));
🛈 Tip
Read more about localized addresses.