Persons

Customer (class)

The Customer CRMScript class represents the following entities:

  • Real-life: a customer (person) that may or may not work for a company or organization
  • SuperOffice UI: contact
  • Database table: person
๐Ÿ›ˆ Note
All associates (internal employees) have a corresponding person record.

String makeSalutation()

makeSalutation() creates a greeting appropriate for the customer. The string can be used at the beginning of a document or email.

Customer c;
c.load(3);
printLine(c.makeSalutation());

User (class)

The User CRMScript class represents the following entities:

  • Real-life: a user account
  • SuperOffice UI: user
  • Database table: ejuser
๐Ÿ›ˆ Note
To get from a user object to a customer or company object, you must go via the associate table.

Parser variables

Calling toParser() will load fields, prefix them based on the class, and make them available to templates.

๐Ÿ›ˆ Note
Repeated calls will overwrite rather than append the values in the Parser instance.
Parser p;
Customer c;
c.load(4);
c.toParser(p);
printLine(p.getVariable("customer.name", 0));

User u;
u.load(2);
u.toParser(p);
printLine(p.getVariable("user.username", 0));

Here, prefixes are customer and user respectively.