Skip to main content

User Search

The User Search capability resolves the Vault CRM user who submitted a medical inquiry into a Medical Information Cloud Account. It is an additional account search handler that queries the Vault CRM user__sys object and creates Accounts with the MED_Employee record type.

Why it is needed

Account Search resolves the HCP or HCO that an inquiry is about by querying the Vault CRM account__v object. It cannot, however, identify the Vault CRM user (the "Referred By" Sales Representative) who created the inquiry, because that information lives on a different Vault CRM object, user__sys.

User Search is a separate search handler that queries user__sys to resolve that user into a Medical Information Cloud Account. Both handlers run automatically during inbound form processing, and no user interaction is required.

Key behavior

  • Automatic resolution - the handler resolves Vault CRM users to Medical Information Cloud Employee accounts during inbound form processing.
  • Detail lookup only - the handler operates only during automated detail lookups; interactive search returns no results, so it never appears as a manual search source.
  • MDM-driven mapping - field mappings use the same MED_MDM_Field_Mapping__mdt framework as Account Search and are fully configurable.
  • Employee record type - all resolved accounts use the MED_Employee record type and the Vault CRM source.

Prerequisites

User Search builds on the Vault CRM Connector base infrastructure. Before configuring it, make sure the following are in place:

  1. A Named Credential for the target Vault CRM instance (see Account Search).
  2. The Vault CRM value on the MED_Source__c picklist for Account.
  3. The MED_Employee record type on the Account object.
  4. Read access to the user__sys object for the Vault CRM integration user.

Configuration

User Search uses its own set of MDM custom metadata records, separate from Account Search and linked to a dedicated connection (for example, Vault CRM Users).

Register the handler

Add a handler registration so Medical Information Cloud invokes the User Search handler during account search. Register the KLAB_VaultCRMUserSearchHdlr class against the account search interface, and set its execution sequence higher than the standard Account Search handler so the HCP lookup runs first.

Define the connection

Create an MED_MDM_Connection__mdt record (for example, Vault CRM Users) that points at the Vault CRM Named Credential and references the KLAB_VaultCRMUserSearchHdlr handler class.

Map fields

Create MED_MDM_Field_Mapping__mdt records for the connection. Map each Vault CRM user__sys field to the Account field that should receive it. A typical mapping set is:

Medical Information Cloud fieldVault CRM field
MED_External_ID__cusername__sys
FirstNamefirst_name__sys
LastNamelast_name__sys
PersonEmailemail__sys
Phonemobile_phone__sys
MED_Company__ccompany__sys
MED_Country__ccountry_code__v
note

The MED_External_ID__c mapping serves a dual purpose: it populates the Account's external ID field and determines which Vault CRM field the VQL WHERE clause filters on. With the mapping above, the handler queries WHERE username__sys = '<federation_id>'.

You can add more field mappings using the same pattern, as long as the Vault CRM field exists on user__sys and the target field exists on the Account object.

Contact Information records

By default, the User Search handler maps all values directly onto the Account object and does not create separate MED_Contact_Information__c records for Employee accounts.

If you want Contact Information records created automatically, configure Medical Information Cloud to derive them from Account fields:

  1. In MED_Global_Setting__mdt, set MED_Enable_Contact_Info_Mappings__c to true.
  2. In MED_Account_Field_Contact_Info_Mapping__mdt, configure which Account fields map to which Contact Information record types.

For example, a default Phone mapping creates an MED_Phone Contact Information record from the Account's Phone field. Review the default mappings (for Email, Fax, Home_Phone, and Mobile_Phone) and adjust them to match the Account fields the User Search handler populates.