Protected
nameProtected
requestProtected
Optional
sessionRetrieves the alias (name) of the currently connected database
Retrieves the current license name
Retrieves the current user code, e.g. "CRM01"
Retrieves the current user full name
Retrieves the group memberships of the current user as semicolon separated string list, e.g. "1;28;292;936"
Retrieves the current user key
Retrieves the current user timezone
Consult your favorite records.
Optional
entity: stringThe entity name, e.g. "Comp"
const compFavorites = crm.consultFavorites("Comp");
The entity name, e.g. "Comp"
A list of field names to match (used as WHERE criteria), e.g. ["NAME", "OPENED"]
A list of values to match, e.g. ["Efficy", "1"]
SQL sort expression, e.g. "K_COMPANY desc"
Selects records that exactly match certain field values
const morningMeetings = crm.consultManyEx("Acti", ["PLANNED", "D_BEGIN"], ["1", "2022-03-14 09:00:00"], "D_BEGIN");
Consult your recent records, optionally extended by additional fields.
Optional
entity: string = ""The entity name, e.g. "Comp"
Optional
extraFields: string[] = []A list of extra fields to consult for each recent entity record, e.g. ["POSTCODE", "CITY"]
const compRecents = crm.consultRecent("Comp");
const compRecentsEx = crm.consultRecent("Comp", ["CITY", "COUNTRY"]);
Protected
crmfetchOptional
requestPayload: ModulePostPayloadOptional
requestOptions: RequestInitExecutes a database query stored in QUERIES
Optional
queryParameters: string[]The query parameters delivered via a JS Array
Optional
loadBlobs: boolean = falseIf true, blob fields (e.g. memo, stream) are returned
Optional
recordCount: number = 0If 0, return all records
const tags = crm.executeDatabaseQuery(99990034); // Query "Standard: Top company tags"
Runs a native (SQL) database query, only if the user has SQL Exec the permissions!
The SQL query text
Optional
queryParameters: string[]The query parameters delivered via a JS Array
Optional
loadBlobs: boolean = falseIf true, blob fields (e.g. memo, stream) are returned
Optional
recordCount: number = 0Limit the returned records
Optional
queryParameters: string[]Request the accessible categories - for the current user - of the given entity
The entity name, e.g. "Comp"
const compCategories = crm.getCategoryCollection("comp");
Protected
getOptional
queryArgs: QueryStringArgsRequests the current value of a given Efficy setting.
The name of the setting.
The name of the module (JSON object) that owns the setting.
If true, the settings of type TDateTime will be returned as a string formatted with the ShortDateTime format. If false, it will be returned as a float value.
const workingPeriodFrom = crm.getSetting("user", "WorkingPeriodFrom");
const workingPeriodFromFloat = crm.getSetting("user", "WorkingPeriodFrom", false);
await crm.executeBatch();
workingPeriodFrom.result; // e.g. "30/12/1899 08:00"
workingPeriodFromFloat.result; // e.g. "0.333333333333333
Request a list of system settings. Use the Map object to retrieve settings
const settings = crm.getSystemSettings();
await crm.executeBatch();
settings.map.get("ShortDateFormat"); // e.g. "dd/mm/yyyy"
settings.map.forEach(console.log); // prints each setting on console
Protected
initOpens a consult context for the record identified by entity and key. A context remains memory-resident (on the web server) until it is closed. Always match with a closeContext() call to avoid memory consumption.
The entity name, e.g. "Comp"
The key of the record. Use key = "" to create a new record.
const comp = crm.openConsultObject("comp", compKey)
const dsComp = comp.getMasterDataSet();
const dsCompCustomer = comp.getCategoryDataSet("COMP$CUSTOMER");
const linkedContacts = comp.getDetailDataSet("cont");
await crm.executeBatch();
Opens an edit context for the record identified by entity and key. A context remains memory-resident (on the web server) until it is closed. Always match with a closeContext() call to avoid memory consumption.
The entity name, e.g. "Comp"
The key of the record. Use key = "" to create a new record.
Protected
set
Efficy SDK build around JSON RPC operations send to endpoint "crm/json", the Efficy Enterprise product style. Multiple RPC operations can be registered in a single request until usage of method executeBatch(). Only after this method was executed, the RPC Response objects have data available in their item and items attributes.
Example