# LegalSense Integration — ContactManager Module Manual
# Table of Contents
- Overview
- Setup
- Preparation
- Initial Import
- Nightly Job
- Synchronisation (CM to LegalSense)
- Deletion
- Matter Archiving
- Configuration Reference
- URL Reference
- CM Configuration Changes
- Field Mapping Reference
# Overview
The LegalSense module provides two-way synchronisation between ContactManager (CM) and LegalSense (LS):
- Inbound (LS → CM): Initial full import and optional nightly import of changed clients.
- Outbound (CM → LS): Real-time sync of contacts, matters, addresses, employees, and related data triggered by field changes in CM.
# Setup
# 1. LegalSense configuration
Fill in the login credentials in legalsense.config:
| Setting | Description |
|---|---|
Url | Base URL of the LegalSense environment, e.g. https://epona.legalsense.nl/ |
UserName | API username |
Password | API password (stored encrypted) |
BearerToken | Alternative to username/password — reuse an existing bearer token (stored encrypted) |
ClientIdentifier | Client identifier for the API |
ClientToken | Client token for the API (stored encrypted) |
# 2. General configuration
Check general.config:
WindowsDomainName— Set this to ensure that users imported from LegalSense are created with the matching Active Directory username, which enables Windows Authentication. When using Forms Authentication the user's LS ID is used as the default password (visible in the import result log).
# Preparation
# User matching
Usernames in LegalSense must match the Windows login name when automatic Windows login is used in CM. If they do not match, CM will fall back to matching on the user's e-mail address (between the LS user and the CM user or internal employee record).
# Lookup list URLs
Use these URLs to inspect the various LegalSense lookup lists before configuring the mapping settings:
| List | URL |
|---|---|
| Matter Status | http://<cm>/LegalSenseConfiguration.aspx/List/MatterStatus |
| Client Status | http://<cm>/LegalSenseConfiguration.aspx/List/ClientStatuses |
| Sector | http://<cm>/LegalSenseConfiguration.aspx/List/Sector |
| Branch | http://<cm>/LegalSenseConfiguration.aspx/List/Branch |
| Address Kind | http://<cm>/LegalSenseConfiguration.aspx/List/AddressKind |
| Matter Type | http://<cm>/LegalSenseConfiguration.aspx/List/MatterType |
| Referrer | http://<cm>/LegalSenseConfiguration.aspx/List/Referrers |
| Practice Area | http://<cm>/LegalSenseConfiguration.aspx/List/PracticeArea |
| Practice Group | http://<cm>/LegalSenseConfiguration.aspx/List/PracticeGroup |
| Firm | http://<cm>/LegalSenseConfiguration.aspx/List/Firm |
| Client custom field definitions | http://<cm>/LegalSenseConfiguration.aspx/List/ClientCustomFieldDefinitions |
| Contact custom field definitions | http://<cm>/LegalSenseConfiguration.aspx/List/ContactCustomFieldDefinitions |
| Matter custom field definitions | http://<cm>/LegalSenseConfiguration.aspx/List/MatterCustomFieldDefinitions |
| Users | http://<cm>/LegalSenseConfiguration.aspx/ListUser |
All lists can be exported to a single Excel file:
http://<cm>/LegalSenseConfiguration.aspx/ExportLookupItems
If Windows Authentication is not used, leave WindowsDomainName empty in general.config.
# Initial Import
# Database preparation
- Create an empty CM database.
- Create a new internal company for the client itself:
- Change the contact type to Internal
- Add the address if needed
- Move the company to the Internal Contacts folder
- Open
http://<cm>/LegalSenseConfiguration.aspxto start the import.
# Law, Notary: Chinese Wall
In CM, the Chinese Wall is configured via Activity Type (e.g. MATTER_ADV, MATTER_NOT). In LegalSense this is controlled via practice_group. For correct operation:
- In CM, go to Activity Type
MATTER_NOTand add the external application LEGALSENSE_INTERNAL with:- ExternalID = the
practice_groupID from LegalSense - ExternalCode =
MATTER_NOT(the activity type code)
- ExternalID = the
- Repeat for other activity types as needed.
# Firms
Multiple firms can be defined in LegalSense. Each firm must be manually mapped to an Activity Type in CM:
- In the Activity Type, add the external application LEGALSENSE_INTERNAL with the ID of the Firm from LS as the ExternalID.
- If needed, create multiple contact types with the same suffix.
# What is imported
The Complete Import action imports the following data:
# Lookup Items
Matched on CM Code vs. LS internal ID, or on CM Name vs. LS description (100% match). Firms are not imported.
| LegalSense | CM |
|---|---|
| AddressKind | AddressType |
| PracticeArea | AreaOfLaw (configurable) |
| MatterType | MatterType (configurable) |
| Sector | Segment |
| ContactKind | ActivityRole |
| Referrer | Referral |
| Branch | Industry (configurable) |
# Offices and Users
- Users are created in CM.
- Matching is done on username and e-mail address (matched against the CM user or internal employee).
- An Employee record is created at the internal company.
- Locations are created and each employee is linked to the correct location.
# Practice Groups
- A department is created at the internal company.
- Employees are linked to the department.
- A group is created with the name of the department. Employees are added to or removed from the group when they move between departments.
# Contacts and Addresses
- Contacts
- Contact–Contacts (employees)
- Addresses
# Contacts, Addresses and Matters
- Everything under Contacts and Addresses, plus:
- Clients
- Matters
- Debtors (matter payors)
- MatterContacts (attendees)
# Matters only
- Matters
- Debtors (matter payors)
- MatterContacts (attendees)
# Import All
Imports all missing data into CM. Re-running the import only creates new records (e.g. new users). To also overwrite existing records with LegalSense data, enable the Overwrite option.
For addresses, matter contacts and matter debtors CM checks whether an existing unlinked record already exists. If it does, that existing record is linked to LegalSense instead of creating a duplicate.
When importing employees, phone/fax/e-mail data is copied from the person record to the employee record.
You can also run partial imports using the individual checkboxes:
- LookupItems — update lookup items only; add Overwrite to also update existing items.
- Users — update users (and linked employees/persons) only; add Overwrite to also update existing records.
- Practice Groups — update departments only; add Overwrite to also update existing records.
# Nightly Job
Each night the following jobs run automatically, in this order:
- Cleanup log directory — Deletes old JSON debug files from
\Log\LegalSense. - Lookup items — Re-imports all LS lookup lists into CM.
- Users and offices — Re-imports LS users and their office assignments into CM (unless disabled).
- Practice groups — Re-imports LS practice groups as CM departments (unless disabled).
- Changed clients — Imports contacts that have changed in LS since the last run (when enabled).
The job is skipped entirely if LegalSense is disabled in the configuration.
# Job 1: Cleanup Log Directory
Deletes .json debug files from \Log\LegalSense (relative to the application base directory) that are older than the number of days specified in CleanupLogDirectory. The default is 15 days. Set to 0 to disable cleanup entirely.
Only files with the .json extension are deleted. The directory itself is never removed. Errors during cleanup are logged but do not abort the rest of the nightly run.
# Job 2: Lookup Items
Re-imports all LegalSense lookup lists. The following LS resource types are fetched and matched against CM lookup types:
| LegalSense resource | CM type | Conditions |
|---|---|---|
| AddressKind | AddressType | Always |
| PracticeArea | MatterType or AreaOfLaw | Controlled by SyncMatterPracticeAreaToCMField |
| MatterType | MatterType or AreaOfLaw | Controlled by SyncMatterMatterTypeToCMField |
| Sector | Segment or Industry | Controlled by SyncClientSegment / SyncClientSectorToCMField |
| ContactKind | ActivityRole | Always |
| Referrer | Referral | Always |
| Branch | Industry, Tag, Tag2, or Segment | Controlled by SyncClientBranchesToCMField |
Matching is first attempted by external ID (LS internal ID stored on the CM item's SynchronizableRecords). If no match is found, CM falls back to matching by code or name (case-insensitive, 100% match required).
New items are created when no match is found. The item's SynchronizableRecord is set to the LS resource ID. If the new item is an ActivityRole, it is automatically added to all matter activity types.
Existing items are not overwritten unless the forceOverwrite flag is set (not active during the nightly run). The LS ID is stored or refreshed on the existing item regardless.
After all lookup lists have been imported, the address template upgrade (v5104_AddAddressTemplate) is applied if it has not run yet. This ensures all address template lookup items exist in CM.
Language records for NL (nl-nl) and EN (en-us) are linked to the LegalSense application on every nightly run, so that language-dependent sync fields resolve correctly.
# Job 3: Users and Offices
Re-imports LS users and their office (location) assignments. Skipped when ImportUsersIsDisabled is true.
Offices are fetched from LS and imported as Location records in CM (via ImportOffices). Each office is matched by its LS ID. New locations are created when no match is found.
Users are fetched from the LS users endpoint and imported as follows for each user:
- Skip reserved names — Users named
admin,administrator, orsystemare skipped. - Resolve username — Special characters (
&,/,\,?,#) in the LS username are replaced with_. WhenImportUsersUseEmailAddressPartForUsernameistrue, the part before@in the user's e-mail address is used instead. IfWindowsDomainNameis configured, the domain is prepended (DOMAIN\username) and Windows Authentication is used; otherwise Forms Authentication is used. - Match existing employee — CM first looks up the employee by external ID. If not found, it tries to match by e-mail address against employees at the internal company (only unlinked employees).
- Match or create CmsUser — If no user is linked yet, CM searches for an existing
CmsUserby username and then by e-mail address (SQL fallback). When a match is found but the user is already linked to a different LS user, the match is discarded and a new user is created. - Create new CmsUser — When no existing user can be matched, a new
CmsUseris created. For Windows Authentication and Office 365, no password is set. For Forms Authentication, the initial password is set to<username><userId>and is included in the import log. TheUsersrole is added to all newly created users. - Create Employee and Person — If no employee record exists, a
Personand anEmployeeare created under the internal company. The employee'sCmsUseris linked, and phone/fax/e-mail data is copied from the person record to the employee. - Update existing records — When
forceOverwriteis active (always true for new records), the user's first name, last name, name prefix, e-mail address, and disabled status are updated. The employee's start and end date are set frombegin_dateandend_datein LS. - Office assignment — When the LS API version is above 15.55, the user's primary office is resolved to a CM
Locationand assigned to the employee. - Abbreviation — When
AbbreviationToExternalApplicationis configured, the LS abbreviation is stored as an external ID on the employee under that application name. - Inactive users — When
ImportUsersSkipInactiveUsersistrue, inactive LS users are not created in CM. Already-existing users that become inactive haveIsDisabled = trueset on theirCmsUser. - New user contact folder — After a new user is created, a contact folder is optionally created under the path specified in
ImportUsersCreateContactFolder. The folder name is the employee's display name (last, first format). If a folder with that name already exists with a different owner, the user's ID is appended to make it unique. Outlook sync is enabled for the new user if the MS Exchange sync module is installed.
# Job 4: Practice Groups
Re-imports LS practice groups as CM Department records on the internal company. Skipped when ImportUsersIsDisabled is true (the same flag controls both jobs 3 and 4).
For each practice group from LS:
- Match existing department — CM looks up the department by external ID scoped to the internal company. If not found, a department with the same name is searched at the internal company. A new department is created if no match exists.
- Create CmsRole — A
CmsRoleis created (or found) with the practice group name. Special characters&,/, and\are normalised (replaced withenor spaces) because role names must be safe for use in security expressions. - Synchronise members — The group's
current_memberslist from LS is compared against current CM employees in that department:- Employees that are no longer in the LS group have their department cleared and are removed from the corresponding
CmsRole. - Employees newly added to the group have their department set and are added to the
CmsRole.
- Employees that are no longer in the LS group have their department cleared and are removed from the corresponding
- Update name — The department name is updated from LS when
forceOverwriteis active (always true for new departments, never during the nightly run for existing ones unless the overwrite flag is explicitly set). - Disable flag — If LS returns no practice groups at all,
DisablePracticeGroupis set totruein the LegalSense configuration to suppress practice-group-related sync operations. It is reset tofalseas soon as groups are found again.
# Job 5: Changed Clients Import
Runs only when ImportChangedClientsIsEnabled is true.
The job queries LegalSense for all contacts, addresses, and contact-contacts whose modified_date is greater than or equal to the last run date (defaults to 1 day ago on the first run). Each record is processed individually in its own transaction.
# Phase 1: Changed contacts
# Step 1: Already linked
If the LS contact ID is already stored as an external ID on a CM contact (application LEGALSENSE), CM updates the contact data (name, email, phone, etc.) and refreshes the export date to the LS modified_date. No address or employee records are touched in this path.
# Step 2: Not yet linked — client check
If no CM contact is linked to the LS contact ID, CM checks whether the LS contact is registered as a client (api/v3/clients?contact=<id>). If the contact is not a client it is skipped entirely.
# Step 3: Match by name or identifier
If the LS contact is a client, CM searches for an existing CM contact:
- Companies — matched by organisation number, VAT number, or organisation name.
- Persons — matched by gender, name prefix, last name, first name, initials, and e-mail address.
If a match is found but is already linked to a different LS record, it is treated as no match and a new contact is created instead (step 4).
If a match is found and it is not yet linked, it is linked to the LS client. Addresses are then imported for the contact. For organisations, LS employee (LSContactContacts) records are also imported: each LS person is first looked up in CM by external ID; if not found, CM attempts to match an existing unlinked person at the company (matched on last name, with gender, prefix, and first name used as tie-breakers). Persons that cannot be matched are created. After person resolution, the LSContactContacts link is imported as a CM Employee record.
# Step 4: No match — create new
A new CM contact (company or person) is created from the full LS contact record. Addresses and employees are then imported using the same logic as step 3.
After creation, the export date on the contact is set to the LS modified_date.
# Phase 2: Changed addresses
For each changed LS address, CM looks up the address by its LS external ID. If not already linked in CM it is silently skipped. If found, the address fields are updated on the existing CM address record.
# Phase 3: Changed contact-contacts
For each changed LS contact-contact, CM looks up the corresponding Employee record by its LS external ID. If not already linked in CM it is silently skipped. If found, the employee link fields are updated.
This job is an alternative to running a full contact import nightly. It is intended for installations where the CM contact database is already in sync with LegalSense and only incremental changes need to be applied.
You can also trigger this import manually:
http://<cm>/LegalSenseConfiguration.aspx/ImportChangedClients
http://<cm>/LegalSenseConfiguration.aspx/ImportChangedClients?lastChangeDate=2024-01-01
# Synchronisation (CM to LegalSense)
# Required external application filter
When SyncRequiredExternalApplication is configured, every outbound sync is gated on the presence of a SynchronizableRecord for that application on the object being synced. If the record does not carry such a link, the sync is skipped entirely for that object (the ExecuteBefore hook returns false). This applies to all entity types (contacts, addresses, employees, matters, etc.).
# Employee
When an employee is synchronised, phone, fax and e-mail data is written to LegalSense. Any personal phone/fax/e-mail data on the person record is overwritten.
# Address
Each address can have an address template that controls the formatting in LegalSense. In CM you can optionally add an external link per country with the name LEGALSENSE and the LS template number as the ExternalID. If no template is set for the country, the default from DefaultAddressTemplate is used.
Address templates:
| ID | Constant | Description |
|---|---|---|
| 1 | AT_SPECIFY_MANUALLY | Use full_address (for backwards compatibility; avoid if possible) |
| 2 | AT_NL_TAV | NL with "t.a.v." (to the attention of) |
| 3 | AT_NL | NL without "t.a.v." |
| 4 | AT_UK_ATTN | UK with attention |
| 5 | AT_UK | UK without attention |
| 6 | AT_DU_ZHD | Germany (z.H.) |
| 7 | AT_USA_ATTN | USA with attention |
| 8 | AT_USA | USA without attention |
| 9 | AT_CM | NL — "de heer" / "mevrouw" shown conditionally; "t.a.v. de crediteurenadministratie" when contact is an organisation with no contact person and no department |
| 10 | AT_CM_TAV | NL with "t.a.v." (CM variant) |
| 11 | AT_NL_TAV_FIRSTNAME | NL with "t.a.v." using first name with fallback to initials |
| 12 | AT_CM_DEFAULT_SALUTATION | NL — "de heer" / "mevrouw" always shown on the attention line regardless of title |
| 13 | AT_INTERNATIONAL_ATTN | International with attention |
| 14 | AT_SE_ATT | Sweden |
| 15 | AT_INTERNATIONAL_PERSON_FIRST | International — contact person on first line (US style) |
| 16 | AT_DK_ATT | Denmark |
| 17 | AT_CM_WITHOUT_ATTN | NL (CM variant) without attention line |
| 18 | AT_INTERNATIONAL_FIRSTNAME | International — uses first name with fallback to initials, without attention line |
Templates can be imported into CM automatically via:
http://<cm>/LegalSenseConfiguration.aspx/ImportAddressTemplates
http://<cm>/LegalSenseConfiguration.aspx/ImportAddressTemplates?forceOverwrite=true
The endpoint sets a default template for each of the predefined countries (NL, BE, GB, DE, US, FR, IT, ES, PT, SE, DK, AU, CA, NZ) if no template is configured yet. Use forceOverwrite=true to overwrite existing values. The response shows which countries were updated and lists all known template IDs.
To configure a template for any other country manually, go to CRM Configuration → Lookup Items, select Country, find the country, and set its External ID (application: LEGALSENSE) to the desired template ID from the table above.
# VAT (BTW)
The VAT code is calculated automatically based on:
- The country of the contact's default postal address (EU membership can be adjusted via the country list in CM).
- Whether a VAT number is present.
| Situation | Code |
|---|---|
| Country = NL | 1 |
| Country outside EU | 3 |
| Country inside EU, with VAT number | 2 |
| Country inside EU, without VAT number | 1 |
The default tax country code is set via DefaultTaxCountryCode (default: NL).
# Invoice e-mail address
A default invoice e-mail address can be stored on a debtor (semicolon-separated for multiple addresses). When the debtor is selected on a matter, the invoice e-mail address is copied from the contact to the matter/debtor combination. The address can then be modified or removed at matter level.
Changing the default invoice e-mail address on the contact does not automatically update the address on existing matters.
When ShowDebtorBillEmailAddressExistingEmailAddressesOnly = True:
- 1 or 2 addresses: first address →
to_email, second →cc_email - More than 2: first →
to_email, remainder →cc_emails_custom
When ShowDebtorBillEmailAddressExistingEmailAddressesOnly = False:
- 1 or 2 addresses: first →
to_emails_custom, second →cc_emails_custom - More than 2: first →
to_emails_custom, remainder →cc_emails_custom
# Dunning
A dunning e-mail address can be stored on a contact and is synchronised to LegalSense. Use NoDunningLookupFieldValueCode to specify a lookup field value code that marks contacts as exempt from dunning. Create a LookupField/LookupFieldValue in CM; when a company or person has that value set, dunning is disabled for that contact in LegalSense.
# Client Code
The ClientCode from LegalSense can be stored in CM and is displayed on the contact detail screen next to the name. Enable this via UseClientCode.
To retroactively assign client codes to existing contacts:
http://<cm>/LegalSenseConfiguration.aspx/UpdateClientCode
# Bank Account Numbers
Bank account numbers can be imported retroactively from LegalSense:
http://<cm>/LegalSenseConfiguration.aspx/ImportBankAccountNumbers
Warning: Existing bank account numbers in CM will be overwritten.
# Branches
Branches in LegalSense can be populated from CM data using SyncClientBranchesToCMField. The nightly sync also imports branches (except for custom fields). If branch sync is activated after the initial import, use this URL to import existing branches into CM:
http://<cm>/LegalSenseConfiguration.aspx/ImportBranch
# Custom Fields
Values from CM can be synchronised to LegalSense custom fields via MatterCustomFields, CompanyCustomFields and PersonCustomFields.
Syntax (semicolon-separated for multiple fields):
<CM field name>=<LS custom field name>
To sync a LookupFieldValue:
LookupField.<CM LookupField code>=<LS custom field name>
Example — sync the WWFT lookup field to an LS custom field named "WWFT":
LookupField.WWFT=WWFT
By default, the CM lookup item's Code is stored in LS. This can be overridden by adding an external application named LEGALSENSE to the lookup item; the ExternalID value is then written to LS instead.
For hierarchical lookup fields you can also sync a parent value:
LookupField.Expertise.Parent=Expertise # sync the direct parent
LookupField.Expertise.Root=ExpertiseRoot # sync the root/top value
This also works with the IndustryCode field.
To sync the DMSforLegal URL stored in CM (via the ExternalCode of the DMSFORLEGAL application) to an LS custom URL field, use the special field name DMSFORLEGAL:
DMSFORLEGAL=<LS custom field name>
# AML Required
A CM custom field value can be mapped to the aml_required flag in LegalSense. The value of the code or ExternalID of the custom field item must resolve to true/false (yes, true, 1, -1, ja, etc.). Configure this via SyncMatterAmlRequiredFromCustomField.
Alternatively, add an external application named LEGALSENSE to the custom field item, and the ExternalID is used as the true/false value.
# Billing Instructions
Set SyncClientBillingInstructions to true to synchronise billing instructions entered in CM to LegalSense.
If this setting is enabled after LegalSense already contains billing instructions, import the existing instructions into CM first (this will overwrite CM values):
http://<cm>/LegalSenseConfiguration.aspx/ImportClientBillingInstructions
# Matter: When to Create in LegalSense
Matter creation in LegalSense can be restricted using one or more of the following settings:
SyncMatterIfVerified— only create the matter in LS when it is verified in CM.SyncMatterEnabledForActivityTypes— only create the matter in LS for specific activity types.SyncMatterMinimalOpenDate— only create the matter in LS if its open date is on or after the configured date.
# Matter: Archive Date
In CM both a close date and an archive date can be set. SyncMatterArchiveDateField controls which value is synchronised to archive_date in LegalSense. Leave empty to disable.
# Matter: Archive Number
LS → CM:
SyncMatterArchiveNumberFromLStoCM— copiesarchive_number(comment field) from LS to CM when a matter is updated.SyncMatterRealArchiveNumberFromLStoCM— copiesreal_archive_numberfrom LS to CM. If both settings are active, both values are combined in CM's ArchiveNumber field separated by/.
CM → LS:
SyncMatterArchiveNumberFromCMtoLS— set toArchiveNumberorRealArchiveNumberto sync the CM archive number back to LS. These options are mutually exclusive with the two LS→CM options above; configure the sync in one direction only.
# Matter: Soft-Kill Status
SyncMatterSoftKillStatusField controls which CM date field (CloseDate or ArchiveDate) triggers the softkillstatus in LegalSense. When the field has a value, status is set to 2 (inactive); otherwise 1 (active). Leave empty to disable.
When this setting is active, CM validates that the matter may be closed before setting the close or archive date.
# Matter: Status Codes
Matter status in LegalSense can be updated automatically based on CM events. Configure the internal LegalSense matter status IDs:
| Setting | Trigger |
|---|---|
MatterStatusCodeNewID | New matter created, or matter not yet verified (when SyncMatterIfVerified is used) |
MatterStatusCodeClosedID | CM close date has a value |
MatterStatusCodeActiveID | CM matter is reopened (close date cleared) |
MatterStatusCodeArchivedID | CM archive date has a value |
Use the following URL to list all matter status values with their IDs:
http://<cm>/LegalSenseConfiguration.aspx/ListMatterStatus
# Matter: Chinese Wall
Set SyncMatterChineseWallFromActivityType to true to populate the chinese_wall_kind field in LS. The available values for this field differ per customer — request the list from LegalSense support. For each type, create an Activity Type in CM (with prefix MATTER_) and add an external application named LEGALSENSE_CHINESEWALL with the LS-supplied ID as the ExternalID.
# Deletion
When a contact or matter is deleted in CM, it is not deleted in LegalSense. An e-mail notification is sent to the data steward requesting manual deletion in LegalSense.
An address is deleted in LegalSense. If deletion fails, an error notification is sent to the data steward by e-mail.
# Matter Archiving
By default a matter is closed in LegalSense when a close date is entered in CM. The user receives an error message in CM if LS refuses to close the matter.
If Matter.ArchiveMatterRole is set, the matter is not archived when the close date is filled, but only when the archive date is entered in CM. At that point the archive number can also be entered in CM and is synchronised to LegalSense.
# Configuration Reference
All settings are stored in legalsense.config. Changes take effect after saving and reloading the configuration page.
# Authentication
# Url
Base URL of the LegalSense API. Example: https://epona.legalsense.nl/
The module automatically appends /api/v3/ if not already present. The older /api/v1/ path is migrated automatically.
# UserName
Username for LegalSense API authentication.
# Password
Password for LegalSense API authentication. Stored encrypted.
# BearerToken
Bearer token for API authentication. Use this to reuse an existing session token instead of username/password. Stored encrypted.
# ClientIdentifier
Client identifier for the LegalSense API (used with OAuth/client-credentials flows).
# ClientToken
Client token for the LegalSense API. Stored encrypted.
# Disabled
Master switch. When true, all LegalSense integration (inbound and outbound sync) is disabled. The integration is also disabled automatically when Url is empty.
# Import — General
# ImportCountryMapping
Mapping from LegalSense country name to ISO2 country code, used during import when the country cannot be resolved automatically.
Syntax: <LS country name>=<ISO2 code>, semicolon-separated for multiple entries.
Example: The Netherlands=NL;Germany=DE
# ImportUsersIsDisabled
When true, users and offices are not imported during the nightly sync. Disables the Users and Practice Groups nightly jobs entirely. Default: false.
# ImportUsersCreateContactFolder
Specifies the parent folder name (or / for root) in which a contact folder should be created for each new user. Leave empty to disable automatic folder creation.
# ImportUsersUseEmailAddressPartForUsername
When true, the part of the user's e-mail address before the @ is used as the username in CM. Default: false.
# ImportUsersSkipInactiveUsers
When true, inactive LS users that do not yet exist in CM are not created. Default: false.
# ImportChangedClientsIsEnabled
When true, the nightly job imports all clients changed in LegalSense since the last run. See Changed Clients Import for the full matching logic. Default: false.
# SyncRequiredExternalApplication
When set, only objects that have a SynchronizableRecord for this external application are synchronised from CM to LegalSense. For example, setting this to ASSYST ensures that only contacts already registered in ASSYST are pushed to LegalSense. Leave empty (default) to sync all objects without restriction.
# CleanupLogDirectory
Number of days after which JSON debug files in \Log\LegalSense are deleted during the nightly job. Set to 0 to disable cleanup. Default: 15.
# Debug
When true, API responses are dumped as JSON files to \Log\LegalSense for debugging.
# Import — Addresses
# AddressKindsInActive
One or more address type names (from LegalSense) whose addresses should be marked as inactive in CM during import.
Default: ["Vorig adres"] (Previous address)
# DefaultAddressKind
Default LegalSense address kind ID used when no kind is specified. Default: 1.
# DefaultAddressKindPostalAddress
LegalSense address kind ID that maps to the CM postal address. When an imported address has this kind, it is set as the postal address on the contact's location.
# DefaultAddressKindVisitorAddress
LegalSense address kind ID that maps to the CM visitor address. When an imported address has this kind, it is set as the visitor address on the contact's location.
# DefaultAddressTemplate
Default LegalSense address template ID used when no template is configured for the country. Default: 4 (UK with attention).
See Address for the full list of template values.
# Contacts — Import
# UseClientCode
When true, the client code from LegalSense is stored in CM and shown on the contact detail screen. Default: true.
Retroactive assignment: http://<cm>/LegalSenseConfiguration.aspx/UpdateClientCode
# PersonSalutationOverwrite
When true, the salutation is always overwritten from LegalSense. When false, the salutation is only written if empty in CM. Default: true.
# PersonAttentionOverwrite
When true, the address_label_name.attention value from LegalSense is written to the attention field in CM. Default: false.
# PersonAttentionOverwriteWithCustomAttention
When true, the custom_attention value (if present) is written to the attention field instead of the standard attention. Default: false.
# SyncPersonSuffix
When true, the person's suffix title is synchronised to LegalSense. Default: false.
# Contacts — Sync (CM to LS)
# SyncClientOriginatingUserToCMField
Controls which CM field is written to the originating_user field in LegalSense. Use Owner or OwnerSub. Default: OwnerSub.
# SyncClientReferral
When true, the first referral on the contact in CM is synchronised to the referrer field in LegalSense. Default: true.
# SyncClientSegment
When true, the first segment on the contact in CM is synchronised to the sector field in LegalSense. Default: true.
# SyncClientSectorToCMField
Specifies the CM field used as the source for the LegalSense sector field. Supported values: Industry, IndustryCode, Interest, Segment, Tag, Tag2, Referral, StockExchange.
Leave empty to use the default SyncClientSegment behaviour.
# SyncClientBranchesToCMField
Specifies the CM field used as the source for the LegalSense branches field (only the first item is synchronised). Supported values: Industry, IndustryCode, Segment, Tag, Tag2, or a LookupField Code.
Leave empty to disable.
# SyncClientBillingInstructions
When true, billing instructions entered in CM are synchronised to LegalSense. Default: false.
Retroactive import: http://<cm>/LegalSenseConfiguration.aspx/ImportClientBillingInstructions
# SyncClientStatusId
LegalSense client status ID to assign when a new client is created. Set to 0 to use the LegalSense default. Default: 0.
# ClientStatusCodeActiveID
LegalSense client_status ID assigned when a client is active. Default: 1.
# ClientStatusCodeClosedID
LegalSense client_status ID assigned when a client is inactive (contact deactivated in CM). Default: 2.
# ContactDetailsKindToEmailID
LegalSense contact_details kind ID for the to_email field. Default: 1.
# ContactDetailsKindCCEmailID
LegalSense contact_details kind ID for the cc_email field. Default: 1.
# NoDunningLookupFieldValueCode
LookupFieldValue code in CM that, when set on a contact, marks that contact as exempt from dunning in LegalSense (has_dunning = false). Leave empty to disable.
# SyncCompanyUseDisplayName
When true, the company's display name is always synchronised to LegalSense instead of the official name. Default: false.
# SyncCompanyContactUseOfficialName
When true, the company's official name is always written to the LS contact record, even when SyncCompanyUseDisplayName is enabled. Default: false.
# SyncCompanyUseAliasToAlternativeName
When true, the company's alias name is synchronised to alternative_names in LegalSense. When false, the previous name is used. Default: false.
# CreateClientUseClientCodeFromExternalApplication
When specified, the client code for new clients is fetched from the ExternalCode field of the given external application. Leave empty to use LegalSense-generated codes.
# AbbreviationToExternalApplication
When specified, the abbreviation field is written to the given external application (e.g. for QUBIS integration). Leave empty to disable.
# DefaultTaxCountryCode
Default ISO2 country code used for VAT calculation when no country is set on the address. Default: NL.
# SyncToDefaultThenCustom
When true, CM first attempts to write a value to a standard LS property; if no standard property matches, it falls back to custom_fields. When false, values are always written to custom_fields only. Default: false.
# Companies — Custom Fields
# CompanyCustomFields
Defines which CM company fields are synchronised to LegalSense custom fields. See Custom Fields for syntax.
Format: <CM field name>=<LS custom field name>, semicolon-separated.
# Persons — Custom Fields
# PersonCustomFields
Defines which CM person fields are synchronised to LegalSense custom fields. See Custom Fields for syntax.
Format: <CM field name>=<LS custom field name>, semicolon-separated.
# Matters — General
# NewMatterChangeOwnerForClient
When true, the client owner in CM is updated when the first matter is created. Default: false.
# NewMatterSendEmail
Comma-separated list of recipient roles notified when a new matter is created in LegalSense. Default: CreatedBy,OwnerSub.
# ChangeMatterSendEmail
Comma-separated list of recipient roles notified when an existing matter is changed. Default: ModifiedBy.
# MatterContactActivityRoleCodeForClient
Activity role code in CM used for matter–client relationships. Default: Client.
# SyncMatterIfVerified
When true, a matter is only created/synchronised in LegalSense after it has been verified in CM. Default: false.
# SyncMatterEnabledForActivityTypes
When specified, only matters of the listed activity types (codes) are synchronised to LegalSense. Leave empty to sync all matter types.
# SyncMatterMinimalOpenDate
Matters with an open date before this date are not created in LegalSense if they do not yet exist there. Leave empty to disable.
# UseOwnerForMatterPracticeGroup
When true, the matter's office/location and department are updated from the selected owner (OwnerSub). Default: false.
# DisablePracticeGroup
When true, the practice group is not set when synchronising a matter. Default: false.
# MarkMatterAsRemoved
When true, setting the soft-kill status to 3 in LegalSense is triggered when a matter is removed in CM, and an e-mail notification is sent. Default: false.
# Matters — Field Mapping
# SyncMatterDescriptionToCMDescription
When true: CM description (first tab) → billing_instructions in LS, and CM comments (last tab) → description in LS.
When false: CM matter comments → description in LS, and CM matter description → billing_instructions in LS.
Default: false.
# SyncMatterPracticeAreaToCMField
CM field that receives the LegalSense practice_area value. Use MatterType, AreaOfLaw, or leave empty to disable. Default: AreaOfLaw.
# SyncMatterMatterTypeToCMField
CM field that receives the LegalSense matter_type value. Use MatterType, AreaOfLaw, or leave empty to disable. Default: MatterType.
# SyncMatterReferrerToCMField
CM field or LS custom field name used for the matter referrer. Use referrer, a custom field name, or leave empty to disable. Default: referrer.
# SyncMatterOriginatorToCMField
CM field used for the matter originator. Use Originator, Owner, OwnerSub, or a contact_kind ID (in which case the originator is synchronised as a matter contact). Leave empty to disable.
# SyncMatterSupervisingUserToCMField
CM field used for the matter supervising user. Use Originator, Owner, or OwnerSub. Default: Owner.
# SyncMatterBillingUserToCMField
CM field used for the matter billing user. Use Originator, Owner, or OwnerSub. Default: OwnerSub.
# SyncMatterLongNameToCMField
CM field used for the matter long name. Use Name or a custom field name. Leave empty to disable.
# SyncMatterEnableRecofaForMatterTypes
One or more CM matter type codes for which IsRecofa should be set to true in LegalSense. Matters with other types get IsRecofa = false. Leave empty to leave the value unchanged.
# SyncMatterAmlRequiredFromCustomField
Code of the CM custom field item that is mapped to the aml_required flag in LegalSense. The code or ExternalID must resolve to a boolean value (yes, true, 1, -1, ja, etc.). Leave empty to disable.
# CreateMatterUseMatterCodeFromCM
When true, the matter code from CM is used as the matter code in LegalSense when creating a new matter. Default: false.
# SyncMatterPayorDepartmentToAddress
When true, the department name of the matter payor is written to the selected address in LegalSense.
Warning: If the same address is used by multiple matter payors this will overwrite the value. Default:
false.
# Matters — Archive / Status
# SyncMatterArchiveDateField
CM date field synchronised to archive_date in LegalSense. Use CloseDate, ArchiveDate, or leave empty to disable. Default: CloseDate.
# SyncMatterSoftKillStatusField
CM date field that drives the softkillstatus in LegalSense. When the field has a value, status becomes 2 (inactive); otherwise 1 (active). Use CloseDate, ArchiveDate, or leave empty to disable. Default: CloseDate.
# MatterStatusCodeNewID
LegalSense matter_status ID assigned when a new matter is created (or when SyncMatterIfVerified is active and the matter is not yet verified). Set to 0 to disable. Default: 0.
# MatterStatusCodeActiveID
LegalSense matter_status ID assigned when a matter is reopened (close date cleared). Set to 0 to disable. Default: 0.
# MatterStatusCodeClosedID
LegalSense matter_status ID assigned when the CM close date has a value. Set to 0 to disable. Default: 0.
# MatterStatusCodeArchivedID
LegalSense matter_status ID assigned when the CM archive date has a value. Set to 0 to disable. Default: 0.
# SyncMatterArchiveNumberFromLStoCM
When true, the LS archive_number (comment field) is copied to CM when a matter is updated from LegalSense. Default: false.
# SyncMatterRealArchiveNumberFromLStoCM
When true, the LS real_archive_number is copied to CM when a matter is updated. When both this and SyncMatterArchiveNumberFromLStoCM are enabled, both values are combined in CM's ArchiveNumber field (separated by /). Default: false.
# SyncMatterArchiveNumberFromCMtoLS
Syncs the CM archive number back to LegalSense. Set to ArchiveNumber to update archive_number in LS, or RealArchiveNumber to update real_archive_number (the CM value must be an integer). Leave empty to disable.
Note: Mutually exclusive with
SyncMatterArchiveNumberFromLStoCMandSyncMatterRealArchiveNumberFromLStoCM. Configure the sync in one direction only.
# SyncMatterNotesFromCMtoLS
CM field synchronised to the LS matter notes. Use Text1 or Text2. Leave empty to disable.
# SyncMatterChineseWallFromActivityType
When true, the chinese_wall_kind field in LegalSense is populated from the ExternalID of the LEGALSENSE_CHINESEWALL application stored on the Activity Type record. Default: false. See Matter: Chinese Wall.
# SyncMatterArchiveNumberFromCMtoLS
(See above under archive number settings.)
# Matters — Custom Fields
# MatterCustomFields
Defines which CM matter fields are synchronised to LegalSense custom fields. See Custom Fields for syntax.
Format: <CM field name>=<LS custom field name>, semicolon-separated.
# RetentionPeriod
CM LookupField code used to populate the retention_period field in LegalSense Matter Archive Information. Leave empty to disable.
# URL Reference
| Action | URL |
|---|---|
| Open import UI | http://<cm>/LegalSenseConfiguration.aspx |
| List matter statuses | http://<cm>/LegalSenseConfiguration.aspx/ListMatterStatus |
| List users | http://<cm>/LegalSenseConfiguration.aspx/ListUser |
| List any lookup type | http://<cm>/LegalSenseConfiguration.aspx/List/<TypeName> — see table below for accepted type names |
| Export all lookups to Excel | http://<cm>/LegalSenseConfiguration.aspx/ExportLookupItems |
| Import address templates | http://<cm>/LegalSenseConfiguration.aspx/ImportAddressTemplates[?forceOverwrite=true] |
| Retroactively assign client codes | http://<cm>/LegalSenseConfiguration.aspx/UpdateClientCode |
| Import bank account numbers | http://<cm>/LegalSenseConfiguration.aspx/ImportBankAccountNumbers |
| Import billing instructions | http://<cm>/LegalSenseConfiguration.aspx/ImportClientBillingInstructions |
| Import branches | http://<cm>/LegalSenseConfiguration.aspx/ImportBranch |
| Import changed clients (last day) | http://<cm>/LegalSenseConfiguration.aspx/ImportChangedClients |
| Import changed clients since date | http://<cm>/LegalSenseConfiguration.aspx/ImportChangedClients?lastChangeDate=2024-01-01 |
# List endpoint type names
The List/<TypeName> endpoint accepts the following type names (case-insensitive). Custom field definition endpoints show an extra Identifier, Widget, and Active column.
| Type name(s) | LS API path | Columns |
|---|---|---|
MatterStatus, MatterStatuses | matterstatuses | ID, Name |
ClientStatus, ClientStatuses | clientstatuses | ID, Name |
Sector, Sectors | sectors | ID, Name |
Branch, Branches | branches | ID, Name |
AddressKind, AddressKinds | addresskinds | ID, Name |
MatterType, MatterTypes | mattertypes | ID, Name |
Referrer, Referrers | referrers | ID, Name |
PracticeArea, PracticeAreas, AreaOfLaw | practiceareas | ID, Name |
PracticeGroup, PracticeGroups | practicegroups | ID, Name |
Firm, Firms | firms | ID, Name |
ContactKind, ContactKinds | contactkinds | ID, Name |
SubMatterKind, SubMatterKinds | submatterkinds | ID, Name |
ClientCustomField[Definition][s] | clientcustomfielddefinitions | ID, Identifier, Name, Widget, Active |
ContactCustomField[Definition][s] | contactcustomfielddefinitions | ID, Identifier, Name, Widget, Active |
MatterCustomField[Definition][s] | mattercustomfielddefinitions | ID, Identifier, Name, Widget, Active |
# CM Configuration Changes
# Label translations
Contact.OwnerSub = Originator
Matter.OwnerSub = Originator
Matter.AreaOfLaw =
Matter.MatterType =
# contact.config
ShowReferrals = Person,Company
ShowSegments = Person,Company
# matter.config
ShowMatterType=Visible|Required|NotVisible <!-- customer-specific -->
ShowAreaOfLaw=Visible|Required|NotVisible <!-- customer-specific (practice_area) -->
HideDepartment=true <!-- customer-specific (PracticeGroup) -->
HideCurrency=True
CreateNewForType=Person,Company,Employee <!-- customer-specific -->
ShowMultipleMatterPayors=True
# Field Mapping Reference
This section documents the exact field-by-field mapping between ContactManager entities and their LegalSense counterparts. It is derived from the Sync* classes and reflects the actual runtime behaviour. Fields marked new only are written only when creating a new record; fields marked always are written on every sync.
# Company to LSContacts
LS API object: contacts
CM entity: Company
Trigger: any tracked field change on the company; after sync the postal and billing address are also synced.
| Condition | LS field | CM source | Notes |
|---|---|---|---|
| new only | is_organization | true | |
| new only | is_debtor | false | |
| new only | softkill_status | Active | |
| new only | invoice_language | Company.Language | |
| new only | tax_scheme | National | overridden in always pass |
| always | first_name | "" | required by LS API |
| always | last_name | "" | required by LS API |
| always | name_prefix | "" | required by LS API |
| always | is_debtor | true | when default_billing_address is already set in LS |
| always | organization_number | Company.ChamberOfCommerce | |
| always | organization_name | Company.OfficialName | use Company.Name when SyncCompanyUseDisplayName = true and SyncCompanyContactUseOfficialName = false |
| always | vat_number | Company.TaxNumber | |
| always | invoice_language | Company.Language | |
| always | tax_scheme | calculated | see VAT (BTW) |
| always | softkill_status | Company.InActive | Archived when inactive (if currently Active); Active when active (if currently Archived) |
| always | account_manager_user | Company.Owner | only when ViewOwner includes Company; null otherwise |
| always | has_dunning | LookupFieldValues | false when a value matching NoDunningLookupFieldValueCode is set; defaults to false |
| always | bank_account_iban | Company.BankAccountNumber | only when ShowBankAccountNumber is enabled |
| always | bank_account_bic | Company.BankAccountNumberBIC | only when ShowBankAccountNumber is enabled |
| always | peppol_id | Company.PeppolNumber | only when ShowCompanyPeppolNumber is enabled |
| always | details[phone] | Company.PhoneNumber | kind = phone |
| always | details[cellphone] | Company.MobileNumber | kind = cellphone |
| always | details[fax] | Company.FaxNumber | kind = fax |
| always | details[website] | Company.Website | kind = website; http:// prepended if missing |
| always | details[email*] | various | see E-mail address mapping |
| always | custom_fields | CompanyCustomFields | see Custom Fields |
On delete: softkill_status is set to Archived; the record is not deleted.
# Person to LSContacts
LS API object: contacts
CM entity: Person
Trigger: any tracked field change on the person; after sync the postal and billing address are also synced.
| Condition | LS field | CM source | Notes |
|---|---|---|---|
| new only | is_organization | false | |
| new only | is_debtor | false | |
| new only | softkill_status | Active | |
| new only | invoice_language | Person.Language | |
| new only | tax_scheme | National | overridden in always pass |
| always | is_debtor | true | when default_billing_address is already set in LS |
| always | first_name | Person.FirstName | falls back to Person.ChristianNames if empty |
| always | last_name | Person.LastNameNoLastNamePrefix | last name without prefix |
| always | name_prefix | Person.LastNamePrefix | e.g. "de", "van" |
| always | initials | Person.Initials | auto-derived as "X." from first name when empty |
| always | gender | Person.GenderType | Male / Female / null (unknown) |
| always | birthdate | Person.BirthDate | format yyyy-MM-dd; null when not set |
| always | title | Person.Title | |
| always | suffix_title | Person.Suffix | only when SyncPersonSuffix = true |
| always | salutation | Person.GetSalutation(Formal) | only when PersonSalutationOverwrite = true; culture from person language or domain default |
| always | address_label_name.internal | Person.GetAttention() | only when PersonAttentionOverwrite = true |
| always | attention | Person.CustomAttention | only when PersonAttentionOverwriteWithCustomAttention = true |
| always | invoice_language | Person.Language | |
| always | tax_scheme | calculated | see VAT (BTW); uses person's postal address |
| always | softkill_status | Person.InActive | Archived when inactive and not deceased; Active when active (if currently Archived) |
| always | account_manager_user | Person.Owner | only when ViewOwner includes Person |
| always | has_dunning | LookupFieldValues | false when NoDunningLookupFieldValueCode is set; defaults to false |
| always | vat_number | Person.TaxNumber | only when ShowPersonTaxNumber is enabled |
| always | bank_account_iban | Person.BankAccountNumber | only when ShowBankAccountNumber is enabled |
| always | bank_account_bic | Person.BankAccountNumberBIC | only when ShowBankAccountNumber is enabled |
| always | details[phone] | Person.PhoneNumber | kind = phone |
| always | details[cellphone] | Person.MobileNumber | kind = cellphone |
| always | details[fax] | Person.FaxNumber | kind = fax |
| always | details[website] | Person.Website | kind = website; http:// prepended if missing |
| always | details[email*] | various | see E-mail address mapping |
| always | custom_fields | PersonCustomFields | see Custom Fields |
On delete: softkill_status is set to Archived; the record is not deleted.
# Contact to LSClients
LS API object: clients
CM entity: Company or Person
Trigger: executed as part of every Company/Person sync when a client record exists (ExternalCode is set), and when a matter is first created for the contact.
| Condition | LS field | CM source | Notes |
|---|---|---|---|
| new only | contact.id | contact external ID | links client to LS contact |
| new only | client_status | SyncClientStatusId | only when > 0 |
| new only | is_billable | true | |
| new only | number | external app ExternalCode | only when CreateClientUseClientCodeFromExternalApplication is set |
| new only | date | Contact.CreateDate | format yyyy-MM-dd |
| new only | reduction_rate | "0.00" | |
| always | name | Company.OfficialName | Company.Name when SyncCompanyUseDisplayName = true; person: Person.GetName() |
| always | alternative_names | Company.AliasName | when SyncCompanyUseAliasToAlternativeName = true; otherwise Company.PreviousName |
| always | parent_client | Company.MemberOf | parent company client; LS version > 15.55 only; null when no parent |
| always | originating_user | Owner or OwnerSub | controlled by SyncClientOriginatingUserToCMField |
| always | is_identified | Identification.FileName | true when identification document is present |
| always | sector | first segment / lookup | controlled by SyncClientSegment or SyncClientSectorToCMField |
| always | branches | collection | controlled by SyncClientBranchesToCMField; only first item synced |
| always | referrer | first referral | only when SyncClientReferral = true |
| always | billing_instructions | Contact.BillingInstructions | only when SyncClientBillingInstructions = true |
| always | softkill_status | Contact.InActive | Archived / Active |
| always | client_status.id | Contact.InActive | ClientStatusCodeClosedID / ClientStatusCodeActiveID |
Duplicate name: if LS rejects the name as duplicate, the postal city is appended; if still duplicate, the CM entity ID is appended in brackets.
# Address to LSAddresses
LS API object: addresses
CM entity: Address
Trigger: any tracked field change on the address. Company/Person sync always queues the postal address (and billing address if configured) for sync afterwards.
| Condition | LS field | CM source | Notes |
|---|---|---|---|
| always | contact.id | address contact external ID | |
| always | address | Address.AddressLine | when AddressLine is set; otherwise Address.StreetLine |
| always | address_line_2 | Address.StreetLine | when AddressLine is set; otherwise "" |
| always | address_kind.id | Address.AddressType external ID | falls back to DefaultAddressKindVisitorAddress or DefaultAddressKindPostalAddress (for main location's default addresses); then to DefaultAddressKind |
| always | city | Address.City | appended with " !INACTIVE!" when Address.InActive |
| always | country | Address.Country.Name | localised to contact's language |
| always | normalized_country | Address.Country.Code | ISO2 code |
| always | address_template | country LEGALSENSE external ID | falls back to DefaultAddressTemplate |
| always | zipcode | Address.PostalCode |
After sync: the contact's default_billing_address in LS is updated to the postal address (or the address of type BillingAddressTypeCode if configured), and is_debtor is set to true on the LS contact if a billing address exists.
On delete (LS ≥ 18.120): record is deleted via the API. On delete (LS < 18.120): city is suffixed with " !INACTIVE!" and billing address is updated; a notification e-mail is sent if this fails.
# Employee to LSContactContacts
LS API object: contactcontacts
CM entity: Employee
Trigger: any tracked field change on the employee. Syncs company and person first.
| Condition | LS field | CM source | Notes |
|---|---|---|---|
| always | organization.id | Employee.Company external ID | |
| always | person.id | Employee.Person external ID | |
| always | job_description | Employee.JobFunction display name | falls back to Employee.JobTitle |
Communication data written to the person's LSContacts record (overwrites person values):
| LS contact details field | CM source |
|---|---|
details[phone] | Employee.PhoneNumber |
details[cellphone] | Employee.MobileNumber |
details[fax] | Employee.FaxNumber |
details[website] | Employee.Website |
details[email*] | via E-mail address mapping |
On inactive: the LSContactContacts record is deleted and the sync record on the CM employee is removed.
Duplicate: if LS reports the person is already linked to the organisation, the existing record is found by person+organisation ID and the sync record is corrected.
# Matter to LSMatters
LS API object: matters
CM entity: Matter
Trigger: any tracked field change on the matter. Contact (and originator, when configured as matter contact) is synced first; all attendees are synced afterwards.
| Condition | LS field | CM source | Notes |
|---|---|---|---|
| new only | date | Matter.ActivityDate | format yyyy-MM-dd; only when LS version > 17.10 and year > 1800 |
| new only | softkill_status | Active | |
| new only | is_billable | true | |
| new only | number | Matter.MatterCode | only when CreateMatterUseMatterCodeFromCM = true |
| new only | matter_status | MatterStatusCodeNewID | only when > 0 |
| always | client.id | matter client external ID | client is created in LS if it does not yet exist |
| always | firm.id | Matter.ActivityType LEGALSENSE_INTERNAL external ID | identifies the LS firm for the matter |
| always | name | Matter.Name | Matter.LongName when SyncMatterLongNameToCMField = "name" |
| always | description | Matter.Comments | when SyncMatterDescriptionToCMDescription = false (default) |
| always | billing_instructions | Matter.Description | when SyncMatterDescriptionToCMDescription = false (default) |
| always | description | Matter.Description | when SyncMatterDescriptionToCMDescription = true |
| always | billing_instructions | Matter.Comments | when SyncMatterDescriptionToCMDescription = true |
| always | invoice_language | Matter.Language | |
| always | matter_type.id | Matter.MatterType or Matter.AreaOfLaw | controlled by SyncMatterMatterTypeToCMField |
| always | practice_area.id | Matter.MatterType or Matter.AreaOfLaw | controlled by SyncMatterPracticeAreaToCMField |
| always | practice_group.id | Matter.Department LEGALSENSE_INTERNAL external ID | null when DisablePracticeGroup = true |
| always | supervising_user.id | Matter.Owner, Matter.OwnerSub, or Matter.Originator | controlled by SyncMatterSupervisingUserToCMField |
| always | billing_user.id | Matter.Owner, Matter.OwnerSub, or Matter.Originator | controlled by SyncMatterBillingUserToCMField; not set when HideBillingTimeKeeper |
| always | originating_user.id | Matter.Owner, Matter.OwnerSub, or Matter.Originator | controlled by SyncMatterOriginatorToCMField; when set to a contact_kind ID the originator is synced as a matter contact instead |
| always | client_reference | Matter.ClientReference | |
| always | referrer.internal.id | Matter.Referral LEGALSENSE_INTERNAL external ID | when SyncMatterReferrerToCMField = "referrer"; otherwise stored in a custom field |
| always | engagement_letter_status | Matter.EngagementLetter | is_derived = true when status is Unknown |
| always | chinese_wall_kind | Matter.ActivityType LEGALSENSE_CHINESEWALL external ID | only when SyncMatterChineseWallFromActivityType = true |
| always | archived_date | Matter.CloseDate or Matter.ArchiveDate | controlled by SyncMatterArchiveDateField; null when date is not set |
| always | softkill_status | Matter.CloseDate or Matter.ArchiveDate | controlled by SyncMatterSoftKillStatusField; Archived (2) when date is set, Active (1) otherwise |
| always | matter_status.id | state-based | MatterStatusCodeArchivedID → MatterStatusCodeClosedID → MatterStatusCodeNewID (new/unverified) → MatterStatusCodeActiveID |
| always | is_recofa | Matter.MatterTypeCode | true when code is in SyncMatterEnableRecofaForMatterTypes; false otherwise; not set when list is empty |
| always | custom_fields | MatterCustomFields | see Custom Fields; DMSFORLEGAL key uses the DMSFORLEGAL application ExternalCode |
Archive information (LSMatterArchiveInformation):
| LS field | CM source | Notes |
|---|---|---|
notes | Matter.ArchiveNumber | when SyncMatterArchiveNumberFromCMtoLS = "ArchiveNumber" |
notes | Matter.Text1 or Matter.Text2 | when SyncMatterNotesFromCMtoLS = "Text1" or "Text2" |
number | Matter.ArchiveNumber (int) | when SyncMatterArchiveNumberFromCMtoLS = "RealArchiveNumber"; value must be a valid integer |
retention_period | LookupField value (int) | configured by RetentionPeriod; value must be numeric |
Employee contact — client matter contact: when matter.Contact is an Employee, a LSMatterContacts record is also created (or updated) linking Employee.Person to the matter with kind.id = MatterContactActivityRoleCodeForClient. If the existing record points to a different person it is first deleted and recreated. This record is separate from the regular attendee sync.
After sync: all matter attendees (ActivityAttendee) are queued for sync. The CM contact's type is updated to include the "Client" designation via ChangeContactTypeToClient. When NewMatterChangeOwnerForClient = true and the matter is new, the client's owner is updated from Matter.Owner if the client has no owner or the existing owner is disabled/inactive.
Matter debtor reconciliation: after each successful sync, ValidateMatterDebtors runs to reconcile CM MatterPayor records against LSMatterDebtors. If the LS main debtor (split_type = FullRemainingAmount) is not linked to any CM payor, the first unlinked CM payor is assigned to it; if no unlinked payor exists the first CM payor is force-linked.
Matter code: if Matter.MatterCode is empty, it is set from lsMatter.number after creation.
Archive number LS → CM: when SyncMatterArchiveNumberFromLStoCM or SyncMatterRealArchiveNumberFromLStoCM is enabled (and SyncMatterArchiveNumberFromCMtoLS is empty), Matter.ArchiveNumber is updated from the LS archive information after each sync.
Duplicate name: if LS rejects the name as duplicate, the CM matter ID is appended in brackets.
On delete: when MarkMatterAsRemoved = true, the matter is deleted in LS; otherwise an information e-mail is sent to the data steward.
# MatterPayor to LSMatterDebtors
LS API object: matterdebtors
CM entity: MatterPayor
Trigger: any tracked field change on the payor, or when the linked matter or address changes. Contact, address, and matter are synced first.
| Condition | LS field | CM source | Notes |
|---|---|---|---|
| new only | email_source | Debtor | |
| new only | split_type | Percentage | |
| always | debtor.id | contact (company if employee) external ID | |
| always | contact_person.id | Employee.Person external ID | only when contact is an Employee; null otherwise |
| always | matter.id | matter external ID | |
| always | address.id | MatterPayor.Address external ID | |
| always | percentage | MatterPayor.ContactPercentage | only when split_type = Percentage |
| always | billing_reference | MatterPayor.BillReference | only when ShowDebtorBillReference is enabled |
| always | department (on address) | MatterPayor.Department.Name | only when SyncMatterPayorDepartmentToAddress = true and DebtorHideDepartment = false |
Invoice e-mail (when ShowDebtorBillEmailAddress is enabled):
| # addresses | LS fields used |
|---|---|
| 0 | invoice_send_method → RegularMail; to_email, cc_email, to_emails_custom, cc_emails_custom cleared |
| 1–2 | to_email and cc_email set by ID (looked up from contact details); falls back to to_emails_custom / cc_emails_custom if IDs not found |
| 3+ | to_emails_custom[0] = first address; cc_emails_custom = remaining |
Dunning e-mail (when ShowDebtorDunningEmailAddress is enabled):
| # addresses | LS fields used |
|---|---|
| 1 | dunning_to_emails_custom[0] |
| 2 | dunning_to_emails_custom[0], dunning_cc_emails_custom[0] |
| 3+ | dunning_to_emails_custom[0], dunning_cc_emails_custom = remaining |
Before save: is_debtor on the linked LS contact is forced to true if not already set (required by LS before a debtor record can be created).
After sync: the CM contact's type is updated to include the "Payor" designation via ChangeContactTypeToPayor.
On delete: record is deleted unless it is the main debtor (split_type = FullRemainingAmount); the main debtor cannot be deleted via LS API — instead the matter is marked dirty for a full re-sync.
# ActivityAttendee to LSMatterContacts
LS API object: mattercontacts
CM entity: ActivityAttendee
Trigger: synced automatically after every matter sync, and on direct field changes. Contact and matter are synced first.
| LS field | CM source | Notes |
|---|---|---|
contact.id | company external ID (if employee) or contact external ID | |
contact_person.id | Employee.Person external ID | only when contact is an Employee and person ID ≠ company ID; null otherwise |
matter.id | matter external ID | |
kind.id | ActivityAttendee.ActivityRole LEGALSENSE_INTERNAL external ID | |
their_reference | ActivityAttendee.AttendeeReference |
Note: existing records are always deleted and re-created on update, because the LS API does not support changing
contactorkindon an existing matter contact.
After sync: the CM contact's type is updated via ChangeContactTypeToParty using ActivityAttendee.ActivityRoleCode, marking the contact as a party in that role.
On delete: the LSMatterContacts record is deleted unless the matter itself is also being removed.
# E-mail address mapping
The following logic applies to Company, Person, and Employee (for employee, communication fields are written to the linked person's LS contact record).
| CM source | LS field | kind | Flags |
|---|---|---|---|
Contact.EmailAddress | details[email] | email | none |
BillingEmailAddress (0 addresses) | details[email_4] | email_4 | is_billing_cc_email = true (uses general EmailAddress as fallback) |
BillingEmailAddress[0] (1–2 addresses) | details[email_2] | email_2 | is_billing_to_email = true |
BillingEmailAddress[1] (2 addresses) | details[email_4] | email_4 | is_billing_cc_email = true |
EmailAddress (when 1 billing address is set) | details[email_4] | email_4 | is_billing_cc_email = true |
DunningEmailAddress | details[email_3] | email_3 | is_dunning_to_email = true |