Life Sciences Cloud (LSC)
Medical Information Cloud integrates with Life Sciences Cloud (LSC), so that Medical Inquiries raised in LSC can be worked in Medical Information Cloud.
The integration provides three capabilities:
-
Inbound Inquiry sync — an hourly pull that lands LSC Medical Inquiries on the Inbound Form (
MED_Inbound_Form__c) staging object, from which existing Inquiry Management automation creates the Interaction (Case) and Request (MED_Request__c) records. -
Account Search — resolves the people on an LSC interaction: the requester (the healthcare provider or institution the inquiry is about) and the submitting representative (the Medical Science Liaison or Sales Representative who submitted it).
-
Case status writeback — sends the interaction's status back to the LSC org as specialists work it, so the field user who raised the inquiry can see its progress.
All three are configured independently, so an organization can adopt any combination of them — though the inbound sync and the writeback are normally used together, since the writeback reports progress on inquiries the sync brought in.
For background on how Inbound Forms propagate into Interactions and Requests, see Inbound Forms.
Inbound Inquiry sync
The sync is MIC-controlled: Medical Information Cloud runs an hourly scheduled pull against the remote LSC org. No inbound webhook or LSC-side batch job is required beyond the External Client App used for authentication.
How the sync works
On each hourly run, Medical Information Cloud:
- Loads every active Integration Mapping Connection (
IM_Connection__mdt) record whose Integration Type isAFLS. - For each connection, queries the remote LSC org for InquiryQuestion rows that match the connection's configured filter (for example, inquiries in a submitted state).
- Retrieves the requester's primary Contact Point records (email, phone, and address) from the related Account in the LSC org. Only records flagged Primary are retrieved, and where an account has more than one primary of a type, the most recently modified one is used — see How primary Contact Points are chosen.
- Maps each InquiryQuestion to one Inbound Form
(
MED_Inbound_Form__c) record using the Integration Mapping framework field mappings (IM_Field_Mapping__mdt). - Skips forms whose External ID (
MED_External_ID__c) already exists on an Inbound Form in Medical Information Cloud, so re-runs are idempotent. - Inserts the new Inbound Form records. The existing
MED_CreateRequestsForInboundFormsautomation creates one Interaction and one Request per form.
When an LSC Inquiry has multiple questions, Medical Information Cloud
creates one Inbound Form per question. Forms that belong to the same
inquiry share the same Group Identifier (MED_Group_Identifier__c)
and Channel Details (MED_Channel_Details__c), so Inquiry Management
groups them under a single Interaction with a separate Request for
each question.
The InquiryQuestion driver query is fetched in pages, and each page is processed in its own asynchronous job, so a large backlog stays within Salesforce governor limits. Multiple LSC source orgs can be configured as separate connection records; a single scheduled run pulls from every active connection.
Configure the inbound sync
The inbound sync needs a connection of its own, its field mappings, and the hourly schedule:
-
Complete the credential setup in Configure the LSC connection, Steps 1 and 2 — the same
AFLS_ConnectorNamed Credential serves every LSC capability. -
Activate the AFLS Medical Inquiry Integration Mapping Connection (Step 3). It is the connection whose Integration Type is
AFLS; the Account Search connections are separate and are not used by the pull. -
Confirm the field mappings that populate Inbound Form are present, and add them if this organization will not receive them from the Setup plan. See Reference: the inbound Inquiry sync configuration.
-
Register the schedule — see Schedule the pull.
Steps 4 and 5 of the connection setup (the callout permission and the Account Search handlers) are only needed if you also use Account Search.
Account Search
Account Search queries the LSC organization directly over a callout. Accounts and contact details are not copied into Medical Information Cloud in advance; they are retrieved when they are needed and stored only once a result is used.
It resolves two people on an LSC interaction:
-
The requester — the healthcare provider or institution the inquiry is about, stamped on the interaction's account.
-
The submitting representative — a User in LSC, but in Medical Information Cloud an Employee account behind Referred By (
MED_Referred_By__c) on the interaction.
How Account Search works
Account Search runs in two situations.
Automatically, on an inbound inquiry. As an Inbound Form from the sync above is processed, the integration resolves the requester and stamps the account on the interaction, provided that the mapping for that has been configured to stamp the Requester on the Inbound form during the Inquiry pull, and resolves the submitting representative and stamps Referred By. No manual step is required.
Interactively, when a specialist searches. From an interaction, a specialist runs Account Search as they always have. The search queries the LSC organization and returns results alongside local ones. Selecting a result associates it with the interaction and stores the account and its contact details in Medical Information Cloud.
Two search handlers do the work. Each is registered independently, so which of them participates and in what order is configuration rather than fixed behavior:
LSC Account Search handlers
| Handler | Resolves | Record type returned (delivered) | Delivered sequence |
|---|---|---|---|
| AFLS Account Search Handler | Healthcare providers and institutions | MED_HCP, MED_Institution | 10 |
| AFLS User Search Handler | The submitting representative | MED_Employee | 15 |
With the delivered configuration, both handlers are used on every Account Search and the Account Search handler runs first. The two cannot return the same record, because they key their results on different LSC objects: the Account Search handler on the LSC Account id, the User Search handler on the LSC User id. Sequence therefore decides the order the two sets of results are merged, not which of two competing records survives.
That is not fixed. Two fields on each handler's Interface Handler
(mvn__Interface_Handler__mdt) record control it, and an administrator can change either:
- Active — clearing it takes that handler out of Account Search entirely. Deactivate the User Search handler and representatives are no longer resolved from LSC; deactivate the Account Search handler and requesters are not.
- Sequence — determines the order handlers run in, and so the order their results appear in the merged set. Where two sources do return the same external id, the lower-numbered handler's record is the one kept. That cannot arise between these two handlers, but it can once a second connection of the same type or a custom handler is in play.
Both are described in Step 5 — Enable the Account Search handlers, and the field-level reference is in Configuring interface handlers for Account Search V3.
Independently of order, each handler answers only the record-type scopes it serves and abstains from the rest without spending a callout. How that set is determined differs between the two:
-
The Account Search handler's scopes are built in, not configurable. It serves
MED_HCP,Person,All,Institution, andMED_Institution. It abstains when every scope in the request isMED_EmployeeorMED_Non_HCP. The field mappings decide which fields are used for a scope, not which scopes are served or which remote object is queried.Each search queries one remote object, chosen from the scope: an institution-scoped search queries
Account, and every other scope queriesHealthcareProvider.warningBecause
AllandPersonare not institution scopes, a search on those scopes queriesHealthcareProviderand therefore returns no LSC institutions at all. This matters in practice because the delivered Person Search All Account Type Setting is the default search tab, so the scope a specialist lands on first is one that cannot reach LSC institutions.To find an LSC institution, the specialist must search from an Institution-scoped tab. If a request somehow has both a healthcare-provider and an institution scope, the institution scope wins and healthcare providers are not returned.
-
The User Search handler's scope is configurable, within limits. It serves whichever record type its Account field mappings declare —
MED_Employeein the delivered configuration — plus the broadPersonandAllscopes, which are always matched. It abstains from a search scoped only to healthcare providers or institutions.warningRetargeting the representative to a different record type is a configuration change, but only to a record type Medical Information Cloud already knows about:
All,Institution,Person,MED_HCP,MED_Non_HCP,MED_Employee,MED_Institution,MED_Address,MED_Email,MED_Fax,MED_Phone, orMED_Social. The handler discovers its mappings by asking for each of those names in turn, so mappings pointing at a customer-defined Account record type are never found and the handler resolves nothing — silently. Supporting an arbitrary record type requires a platform change (PLTFM-3705).Two further constraints on the target record type:
- It must be active on Account. An inactive record type does not resolve, and the handler makes no callout.
- Every Account field mapping on the connection must name the same record type. The handler takes the record type from the first Account mapping it encounters, and the mapping set is unordered — so a connection whose Account mappings have a mix of record types resolves to an unpredictable one.
noteBecause that record type comes from the mappings, a connection whose Account mappings declare none makes the handler abstain from everything. See Configuration that quietly disables a capability.
So the precedence described above only comes into play for a search both handlers serve — Person
or All. A search scoped to healthcare providers is answered by the Account Search handler alone,
and one scoped to employees by the User Search handler alone; in each case the other handler makes
no callout.
The Account Search handler also abstains from a search filtered by affiliation, because those filters key on local record ids that LSC cannot resolve remotely.
Existing Veeva CRM, Vault CRM, and local Medical Information Cloud searches are unaffected. The LSC handlers only answer searches in organizations where the LSC search connections are active.
What Medical Information Cloud stores
When a result is used, the integration creates or updates:
-
An account, matched on the LSC record's identifier held in External ID (
MED_External_ID__c). Re-resolving the same person updates the existing account rather than creating a duplicate. -
Contact Information (
MED_Contact_Information__c) records for email, phone, and address, keyed so repeat searches update rather than duplicate them. They land on theMED_Email,MED_Phone, andMED_Addressrecord types — fixed for the requester search, which derives the record type from the remote ContactPoint object, and configurable for the representative search, which reads it from the mapping's SF Record Type.How many records you get differs by search, because the two read from different LSC objects:
Requester search Representative search Read from The account's ContactPointEmail,ContactPointPhone, andContactPointAddresschildrenFields on the LSC Userrecord itselfRecords created All of them — an account can have several emails, phones, and addresses One per type — a User holds a single email, phone, and address Keyed on The remote Contact Point id The account's external id plus the record type noteFor the requester search, only one record per type is marked Primary in Medical Information Cloud, even where LSC flags several. Records are considered most-recently-modified first, so the newest primary keeps the flag and any others are stored with Primary unchecked.
-
A Source (
MED_Source__c) value naming the LSC connection that resolved the record. With the delivered configuration that isAFLS_Account_SearchorAFLS_User_Search, so it records which search produced the record. Distinguishing one LSC organization from another takes additional configuration — see Searching more than one LSC organization.warningBoth values are added to the
MED_Sourceglobal value set by the Medical Information Cloud - Setup plan. Because that plan is applied at install time, an organization installed before this release does not have them, andMED_Source__cis a restricted picklist — so the source is simply not stamped. the only symptom is resolved records with an empty Source.Before activating either search connection, confirm the
MED_Sourceglobal value set containsAFLS_Account_SearchandAFLS_User_Search, and that both values are available on the record types the searches write to —MED_HCP,MED_Institution, andMED_Employeeon Account, andMED_Address,MED_Email, andMED_Phoneon Contact Information. Add them if they are missing.
States are stored in ISO 3166-2 form — for example, US-IL — because Medical Information Cloud
composes the country and state that LSC supplies separately.
The account's country is the first of these that the MED_Country value set includes:
- A country mapped from the LSC account itself — any Account Search mapping to
MED_Country__cthat does not go through the owner. The delivered mappings include none. - The account's LSC address — the primary address first, then any address with a country.
- The country of the LSC account's owner, if you add the optional owner mappings. See Optional: fall back to the account owner's country.
A value the org does not have is passed over rather than stamped. If no source yields a country,
the country is left blank and the MED_RequireCountry validation rejects the account, so it cannot
be selected or linked to an interaction. Medical Information Cloud never stamps the Global
(ZZ) value on an account. An address with a country remains the expected source; see
Prerequisites.
If a value from LSC is one the Medical Information Cloud field cannot accept — a picklist value the organization does not have, or an address that is not a valid email address — that single value is skipped and a warning is logged. The rest of the record is still saved.
The country on an address is the exception. A value the MED_Country value set does not include —
Global, for example — is not skipped, and the address fails with a
bad value for restricted picklist field error instead. The account itself still saves if its
country comes from another source.
A state that cannot be composed into a valid value is cleared, without a log entry. If neither the
raw LSC state code nor the composed ISO form (<country>-<state>) is an active value in MED_State__c,
the state is emptied so that the rest of the address still saves. Unlike the other dropped values above,
this one is not logged — an address Contact Information record simply arrives with no state and
nothing to explain it.
If LSC addresses are landing without states, confirm that the ISO 3166-2 values for the countries you
operate in are active in the MED_State__c value set.
Case status writeback
As specialists work an LSC-originated interaction, Medical Information Cloud writes the status back to the LSC org, so a field user can see where their inquiry stands without leaving LSC.
Writeback is scheduled, not immediate. A trigger action flags the interaction when something mapped changes, and an hourly job pushes the flagged records. A status change is therefore visible in LSC within the hour, not instantly.
How writeback works
-
An interaction is treated as LSC-originated when its Channel Details (
MED_Channel_Details__c) matches the developer name of an active LSC Integration Mapping Connection.noteIn practice this means writeback only works for interactions the inbound sync created. Channel Details is what marks an interaction as LSC-originated, and the Incoming Inquiry Group Identifier that addresses the remote record is only ever populated by the Inbound Form automation.
An interaction created any other way whose Channel Details happens to match an LSC connection name is flagged, but has no group identifier — so every run skips it, logs the reason, and clears the flag. Nothing accumulates, but nothing is sent either.
-
The Flag Afls Update trigger action sets Updates Pending (
mvn__MED_Updates_Pending__c) on that interaction — on create, and on update whenever a watched field changes. Watched fields are exactly the Case fields mapped Outbound on that connection, so what triggers a writeback is configuration rather than fixed. -
The hourly AFLS Status Writeback job selects flagged interactions for each active connection and sends them to LSC in pages of up to 200, one callout per page.
-
The remote record is addressed by the Incoming Inquiry Group Identifier (
MED_Incoming_Inquiry_Group_Identifier__c) set by the inbound sync, and the update is applied to the LSC Case. See How the interaction is matched back to LSC. -
Mapped values are translated on the way out through the connection's Integration Value Mapping records.
-
Updates Pending is cleared only once LSC has accepted the update. A failing interaction keeps the flag and is retried, then parked — see Writeback behavior worth knowing.
The writeback targets the LSC Case, not the Inquiry. In LSC the Inquiry is a child of the Case, so the Case has the status the field user sees.
How the interaction is matched back to LSC
Incoming Inquiry Group Identifier (MED_Incoming_Inquiry_Group_Identifier__c) is not the bare
LSC Case id. Inquiry Management composes it when it creates the interaction, from two Inbound Form
fields:
<Channel Details>::<Group Identifier>
which for an LSC-originated interaction resolves to the connection developer name and the LSC Case
id — for example AFLS_Medical_Inquiry::500XXXXXXXXXXXX. The same composition is documented for all
inbound integrations in
Inbound Forms.
The writeback uses both halves:
- The part after the last
::is the LSC Case id the update is sent to. - The part before it must name the connection currently being processed. If it names a different connection, the job refuses to send that id through this connection's Named Credential. This is what makes multiple LSC organizations safe — an interaction's status can only ever be written back to the LSC org that raised it.
Because the prefix is the interaction's Channel Details value as it was when the interaction was created, editing Channel Details afterwards leaves a stale prefix that no longer matches any connection. The interaction is then skipped on every run — the failure is treated as bad data rather than a transient error, so it is logged and the flag cleared, and the status is never sent. Do not edit Channel Details on an LSC-originated interaction.
What is written back
The delivered configuration writes the interaction's Status, translated as follows:
Delivered status value mappings
| Medical Information Cloud status | LSC status |
|---|---|
Open | Assigned |
Closed | Responded |
Cancelled | Responded |
Writeback is not limited to Status. To send any other Case field — including a custom field — add an Outbound Integration Field Mapping on the LSC connection. Adding one has two effects: the field is included in the push, and changes to it begin flagging the interaction for writeback. No code change is required. See Creating and customizing the mappings.
The mapping must satisfy all three of the following, or writeback does not behave as intended:
| Field | Required value | Why |
|---|---|---|
| SF Object | Case | The field is read from the interaction |
| Remote Object | Case | Only Case-targeted mappings are included in the outbound payload |
| SF Record Type | All | The writeback looks up its mappings without naming a record type, so a mapping with a concrete record type is never found |
An Outbound Case mapping whose Remote Object is not Case is worse than inert. It is excluded
from the payload, but it still counts as a watched field — so changing it flags the interaction for
writeback while contributing nothing to send.
If it is the only Outbound Case mapping on the connection, every flagged interaction produces an
empty payload, which is counted as a failure. After three runs the interaction is parked with
Updates Pending still set, and stays that way until Writeback Attempts is reset. Check the
Remote Object value first if interactions are accumulating at the attempt cap.
An Outbound Case mapping with a concrete SF Record Type is silently ignored. It is not
included in the payload and it does not flag interactions — the mapping simply has no effect. Use All.
Enable writeback
Writeback needs the same connection and credential as the rest of the integration, plus its own schedule. Register it the same way as the inbound pull:
mvn.MED_AflsStatusWritebackSchedulable.scheduleHourlyJob();
That registers the job under the name AFLS Status Writeback at the top of every hour. As with the
pull, you are not limited to hourly — the class is schedulable, so System.schedule accepts any cron
expression, and (new mvn.MED_AflsStatusWritebackSchedulable()).execute(null); runs it once,
immediately. See Schedule the pull for the same three options in more detail,
and Scheduling Apex jobs for the cron format.
The inbound pull and the writeback are separate schedules. Registering one does not register the other.
The LSC writeback trigger action
Nothing is ever flagged for writeback without the Flag AFLS Case Update trigger action, so this is the first thing to check when writeback picks nothing up — before the mappings.
The trigger action is a Trigger Action (mvn__TAF_Trigger_Action__mdt) record named
Flag_Afls_Update. The Fall '26 upgrade adds it. To check it: in the Quick Find box in Setup, search for and select Custom Metadata
Types, and click Manage Records next to Trigger Action.
LSC writeback trigger action field values
| Field | Value |
|---|---|
| Label | Flag AFLS Case Update |
| Trigger Action Name | Flag_Afls_Update |
| Apex Class Name | MED_CaseFlagAflsUpdate |
| Apex Class Namespace | mvn |
| Before Insert | Case |
| Before Update | Case |
| Order | 140 |
| Bypass Execution | Unchecked |
| All other context fields (After Insert, After Update, Before Delete, After Delete, After Undelete) | Leave blank |
| Description | Flags an AFLS-originated Case for status writeback to the originating AFLS Case. |
The Trigger Action custom metadata type has no Active field. A trigger action runs when its Apex
class is named, the context field for the event is set to the object API name — here Before Insert
and Before Update both set to Case — and Bypass Execution is unchecked.
Order sequences the action against the other Case trigger actions; 140 is the shipped value and
there is no reason to change it.
Writeback behavior worth knowing
A missing mapping stops writeback without failing. If a connection has no Outbound Case field
mappings, the job logs that pending interactions will not be written back until one is added, and
moves on. Nothing errors and no flags are cleared, so writeback resumes once a mapping exists.
Transient failures are retried up to three times, then the interaction is parked. Each failed
attempt increments Writeback Attempts (mvn__MED_Writeback_Attempts__c). At the third failure the
interaction is given up on and logged, but its flag is not cleared — it stays at Updates
Pending and the job stops selecting it. Parking rather than clearing keeps a failing interaction
visible instead of quietly dropping the status change.
A parked interaction resumes in either of two ways:
- Automatically, the next time a watched field changes. Flagging resets Writeback Attempts to zero, so an interaction that failed three times and is later re-worked is picked up again on the next run.
- Manually, by setting Writeback Attempts back to
0(or blank) on the interaction. Do this after fixing whatever caused the failures — the mapping, the group identifier, or the LSC-side permissions.
Because a parked interaction keeps Updates Pending set, that field on its own does not mean
"waiting to sync." A list view or report of interactions still queued for writeback must also filter
Writeback Attempts to less than 3; anything at 3 or above is parked and needs attention
rather than time.
An access problem in LSC looks like a transient failure. A rejection because the integration user cannot edit the target Case is returned per record, exactly as a transient error is, so it consumes the three retries and then parks the interaction. Every flagged interaction reaching the attempt cap — rather than a scattered few — points at the integration user's access rather than at the network. The Debug Log entry includes the LSC error text verbatim, so an access rejection is named in the message; see Record-level access under private sharing.
Bad data is dropped after one attempt, not retried. A missing or malformed group identifier, or one belonging to a different LSC connection, can never succeed, so it is cleared immediately rather than consuming retries.
An interaction edited mid-run is left for the next run. The job compares the interaction's last modified date against what it read at selection time and only clears the flag when they match. If someone edited the record while the callout was in flight, the flag stays set and the next run picks it up — so a concurrent edit delays writeback rather than losing it.
A partial response is not trusted. If LSC returns a response whose results do not line up one-to-one with the records sent, none of it is trusted and the whole page is retried, rather than risking a status being attributed to the wrong interaction.
Multi-instance is honored. Each active LSC connection is processed independently, and the group identifier records which connection an interaction came from, so a status is only ever written back to the LSC org that raised the inquiry.
Prerequisites
Complete the following before enabling any LSC capability.
| Prerequisite | Description |
|---|---|
| LSC External Client App | On the LSC (source) org, an administrator creates an External Client App with OAuth 2.0 Client Credentials enabled and assigns a Run As user that can read the objects the integration needs. |
| Named Credential | Medical Information Cloud ships the AFLS_Connector Named Credential, the AFLS_Connector_Cred External Credential, and the AFLS_Connector_IDP External Auth Identity Provider (MIC-4778). After install the LSC My Domain URL goes on the Named Credential, and the token endpoint and consumer key/secret on the External Auth Identity Provider — see Step 2. |
| Callout permission set | Required for Account Search. No delivered permission set grants access to the AFLS_Connector credential, so an administrator creates one with External Credential Principal Access for AFLS_Connector_Cred - AFLS_Principal. See Step 4. |
| Integration Mapping Connection metadata | Activate the IM_Connection__mdt records the Setup plan ships for the capabilities you use (see Step 3), pointing at the AFLS_Connector Named Credential. Field and value mappings are delivered as IM_Field_Mapping__mdt and IM_Value_Mapping__mdt records. |
| LSC Run As user permissions | Use a dedicated integration user in the LSC org rather than a named person's account, so the integration does not break when someone changes role or leaves. Inbound sync reads Inquiry, InquiryQuestion, Case, Account, and Contact Point data. Account Search additionally reads Account, HealthcareProvider, User, ContactPointEmail, ContactPointPhone, and ContactPointAddress. Case status writeback additionally needs edit access to the LSC Case object. Where LSC sharing is private, these object permissions are not sufficient on their own — see Record-level access under private sharing. |
| Inbound Form object | Required for the inbound sync. The unmanaged Inbound Form object must be present in the org. Product matching on the resulting Request records follows the standard Inbound Form behavior documented in Inbound Forms. |
| Case writeback fields | Required for Case status writeback. mvn__MED_Updates_Pending__c (Checkbox) and mvn__MED_Writeback_Attempts__c (Number) must exist on Case. They are delivered by the mvn-mic-schema managed package, not by the Setup plan, so writeback needs a schema package version that includes them. Without them nothing is ever flagged and writeback silently never runs. |
| Incoming Inquiry Group Identifier | Required for Case status writeback. MED_Incoming_Inquiry_Group_Identifier__c on Case is the field that addresses the remote LSC record. It is delivered by the main Medical Information Cloud package — a different package from the two fields above — and is populated by the standard Inbound Form automation, not by the LSC integration directly. See How the interaction is matched back to LSC. |
| LSC writeback trigger action | Required for Case status writeback. The Flag_Afls_Update Trigger Action (mvn__TAF_Trigger_Action__mdt) record is what sets Updates Pending. The Fall '26 upgrade adds it to an organization that doesn't have it. To confirm it exists, see The LSC writeback trigger action. |
| Account address with a country | Required for Account Search, including the requester resolution the inbound sync runs. Every LSC account Medical Information Cloud resolves needs a Contact Point Address (ContactPointAddress) whose Country is a value in the MED_Country global value set — an ISO 3166-1 alpha-2 code such as US. Mark it Primary: the inbound sync reads only primary Contact Points, and copies that address's country onto the Inbound Form. Without one, the country must come from another source in the order under What Medical Information Cloud stores; an account with none is rejected. The submitting representative is the exception — its country comes from the LSC User record. See What Medical Information Cloud stores. |
| Representative record type on Account | Required for Account Search. The representative search resolves to whichever record type its Account field mappings declare — MED_Employee in the delivered configuration — so that record type must exist on Account and be active. It must also be one of the record types Medical Information Cloud recognizes; a customer-defined record type is not picked up. See How Account Search works. |
| Account Search V3 | Required for Account Search. Both LSC handlers implement mvn.MED_IAccountSearchV3, so the Use Account Search Version 3 (MED_Account_Search_V3_Enabled__c) field on the Global Setting (MED_Global_Setting__mdt) custom metadata type must be checked. See Account Search Handlers (sources). |
Per-org secrets (LSC My Domain URL, token URL, consumer key, and consumer secret) are configured after install, and are spread across three records — see Step 2. They are never stored in source control, which is why the shipped records have placeholder URLs.
Record-level access under private sharing
Object permissions decide what kinds of records the integration user can read and edit. The LSC org's sharing settings decide which records. Both must be granted.
Where the organization-wide default for Case is Private, giving the integration user Read or
Edit on the object is not enough. It reaches only the records it owns or has been granted access to,
and a dedicated integration user owns nothing. The integration then authenticates successfully and
still behaves as though the LSC org were empty — the pull finds no inquiries to bring across, and the
writeback cannot update the Cases it is addressed to.
Grant record access using whichever of the following fits the LSC org's data model:
Ways to grant the integration user record access
| Approach | How to grant it | When to use it |
|---|---|---|
| Queue membership | Add the integration user to the queue that owns the LSC Cases. Queue members hold edit access to the records the queue owns. | Preferred where LSC already routes inquiry Cases to a queue. It scopes access to the records the integration is meant to handle rather than to the whole org. |
| Object-level View All and Modify All | On the integration user's permission set, grant View All and Modify All for Case — and View All for the other objects the field mappings read. | Where the Cases are not queue-owned. Narrower than the org-wide system permissions, because access stays confined to the named objects. |
| View All Data and Modify All Data | Grant the system permissions on the integration user's profile or permission set. | Last resort. These reach every object in the LSC org, so prefer either row above. |
| Sharing rules | Write a criteria-based or owner-based sharing rule that shares the LSC Cases with the integration user, with Read/Write access. | Where access must follow a data rule — for example a specific record type or business unit — rather than queue membership. |
Grant the narrowest access that works. The integration user reaches patient-adjacent inquiry data, so scoping it to a queue or to named objects gives it access to less data than Modify All Data does, and makes the access straightforward to explain during a review.
Read access is affected as well, not only the writeback. A private sharing model that hides LSC Cases from the integration user produces an inbound pull that reports a successful run and creates no Inbound Forms, because the remote query legitimately returns nothing. There is no error to find. Confirm record visibility before investigating the mappings.
Configure the LSC connection
Step 1 — Configure authentication on the LSC org
On the LSC source org:
- Create an External Client App with Client Credentials flow enabled.
- Assign a Run As user with read access to the objects used by the field mappings — plus edit
access to
Caseif you enable status writeback. See LSC Run As user permissions in Prerequisites, and Record-level access under private sharing if the LSC sharing model is private. - Note the Consumer Key and Consumer Secret.
Step 2 — Configure the credential in Medical Information Cloud
The connection uses three related records, and the values you collected in Step 1 are spread across two of them: the Named Credential and the External Auth Identity Provider.
In an organization installed before Fall '26, create the three records first. In Setup, open Security → Named Credentials and create them in the order below. Use these names exactly, because the integration looks the records up by name.
-
On the External Auth Identity Providers tab, click New and enter these values.
LSC identity provider field values
Field Value Label AFLS Connector IDPName AFLS_Connector_IDPAuthentication Protocol OAuth 2.0 Authentication Flow Type Client Credentials Pass client credentials in request body Selected -
On the External Credentials tab, click New and enter these values. Then add the principal.
LSC external credential field values
Field Value Label AFLS Connector CredName AFLS_Connector_CredAuthentication Protocol OAuth 2.0 Identity Provider AFLS_Connector_IDPLSC principal field values
Field Value Parameter Name AFLS_PrincipalSequence Number 1Identity Type Named Principal -
On the Named Credentials tab, click New and enter these values.
LSC named credential field values
Field Value Label AFLS ConnectorName AFLS_ConnectorExternal Credential AFLS_Connector_CredEnabled for Callouts Selected Generate Authorization Header Selected
Then set the values from Step 1 as described below.
Where each LSC credential value goes
| Value | Record | Field |
|---|---|---|
| LSC My Domain base URL | Named Credential AFLS_Connector | URL |
LSC token endpoint (<My Domain>/services/oauth2/token) | External Auth Identity Provider AFLS_Connector_IDP | Token Endpoint URL |
| Consumer Key and Consumer Secret | External Auth Identity Provider AFLS_Connector_IDP | Client ID / Client Secret |
The URL and Token Endpoint URL both ship with the placeholder https://afls-my-domain-url. Both must
be replaced, on two different records. A callout against the unreplaced placeholder fails to resolve
the host, which reads as a network error rather than a configuration error.
On the Medical Information Cloud org:
-
In Setup, open Security → Named Credentials, select the External Auth Identity Providers tab, and open AFLS Connector IDP.
- Set Client ID to the LSC Consumer Key from Step 1
- Set Client Secret to the LSC Consumer Secret from Step 1
- Set Token Endpoint URL to the
<LSC org's My Domain>/services/oauth2/token. - Leave Pass client credentials in request body selected.
-
In Setup, open Security → Named Credentials. Open AFLS_Connector
- Set URL to the LSC org's My Domain.
- Add
mvnto Allowed Namespaces on the Named Credential.
warningAdding the namespace is required, on a new install as well as an upgrade — the allowance is not part of the shipped metadata. Medical Information Cloud runs as a managed package, and without the allowance the callout fails with a message reporting that the Named Credential might not exist, which is misleading because the credential does exist.
Step 3 — Activate the Integration Mapping Connections
Each LSC capability reads its remote org through an Integration Mapping Connection
(mvn__IM_Connection__mdt, labelled IM Connection in Setup). The connections ship from the
Setup plan inactive, so activate the ones for the capabilities you use. The inbound sync and status
writeback share the AFLS connection, while Account Search uses separate requester and
representative connections, distinguished by Integration Type:
LSC Integration Mapping Connections
| Capability | Integration Type | Shipped connection | Ships active |
|---|---|---|---|
| Inbound Inquiry sync | AFLS | AFLS Medical Inquiry (AFLS_Medical_Inquiry) | No |
| Account Search — requester | AFLS_Account_Search | AFLS Account Search (AFLS_Account_Search) | No |
| Account Search — submitting representative | AFLS_User_Search | AFLS User Search (AFLS_User_Search) | No |
To activate a connection:
- In Setup, open Custom Metadata Types and click Manage Records next to IM Connection.
- Edit the connection, select Active, and save.
Separate Integration Types keep the capabilities independent: the inbound pull dispatcher only
sweeps AFLS connections, and the search handlers only use the search connections.
Each connection record specifies:
- Custom Metadata Record Name — unique identifier for the LSC instance (for
example,
AFLS_Medical_Inquiry). - Integration Type — as in the table above.
- Named Credential —
AFLS_Connector. - Active — must be selected for the connection to be used.
- Where Condition — optional remote SOQL filter. For the inbound pull this is applied to the InquiryQuestion driver query (for example, to limit to inquiries in a submitted state).
Field mappings translate remote LSC fields onto Medical Information Cloud fields. For the
inbound sync they land on Inbound Form fields, and at minimum must populate
External ID (MED_External_ID__c) with a unique value per question so deduplication works
correctly. For Account Search they map the LSC account and user fields onto Account and
Contact Information fields, and Integration Value Mapping records translate LSC account
types into Medical Information Cloud record types.
Each capability queries a fixed set of remote objects, so Remote Object is not free choice — see Remote objects available to each capability.
Both are configuration, not code: retargeting a field or a record type — for example, resolving
representatives to a record type other than MED_Employee — is a configuration change. The record
types available to retarget to are constrained, though — see
How Account Search works.
Integration Mapping Connection and field mapping records ship from the Medical Information Cloud - Setup plan in the Install Service.
Step 4 — Grant the callout permission
Access to the AFLS_Connector credential is granted through External Credential Principal Access
on a permission set.
Medical Information Cloud does not ship a permission set for this. No delivered permission set
grants access to AFLS_Connector or its principal, so an administrator creates one — or adds the
access to an existing permission set the Account Search specialists already hold.
To create one:
- In Setup, open Permission Sets and click New. Give it a label such as
LSC Integration Access. - Open the new permission set and click External Credential Principal Access.
- Click Edit, add
AFLS_Connector_Cred - AFLS_Principalto the enabled principals, and save. - Assign the permission set to every specialist who will run Account Search from an interaction.
Without this, an interactive LSC search returns a warning that the search could not be completed.
Automatic resolution on an inbound inquiry runs in a different user context. As an Inbound Form is processed, the requester and representative resolution runs asynchronously as the Automated Process user, not as the user who registered the scheduled pull.
The Automated Process user cannot be assigned a permission set through the standard Permission Set Assignments interface, so granting it External Credential Principal Access needs to be handled with your Salesforce administrator for the org in question. Confirm this before relying on automatic resolution: if the inbound context cannot reach the credential, Inbound Forms, Interactions, and Requests are still created normally — only the requester account and Referred By are left unresolved, and the reason is logged, not shown to the user. See How LSC entries are logged for where to look.
Step 5 — Enable the Account Search handlers
The connections above give Medical Information Cloud somewhere to search. The Interface
Handler (mvn__Interface_Handler__mdt) records are what put the LSC handlers into the
Account Search pipeline. Two ship with the product:
LSC Account Search interface handlers
| Handler record | Class | Sequence | Ships active |
|---|---|---|---|
| AFLS Account Search Handler | MED_AflsAccountSearchHdlr | 10 | No |
| AFLS User Search Handler | MED_AflsUserSearchHdlr | 15 | Yes |
To enable Account Search:
-
In the Quick Find box in Setup, search for and select Custom Metadata Types.
-
Click Manage Records next to Interface Handler.
-
Open AFLS Account Search Handler and select Active. This record ships inactive, so without this step healthcare providers and institutions are never searched in LSC.
-
Confirm AFLS User Search Handler is also Active.
-
Leave Context set to
MIC - Account Searchon both records, and leave the Sequence values as shipped.
The shipped values are 10 for the Account Search handler and 15 for the User Search handler, so healthcare provider and institution results are merged ahead of representative results. Because the two handlers key on different LSC objects they never return the same record, so the order affects presentation rather than which record wins. Give handlers distinct sequences anyway: where two sources can return the same external id — a second connection of the same type, or a custom handler — the lower number takes precedence, and equal values leave that undefined.
For a field-by-field reference on these records, see Configuring interface handlers for Account Search V3. Both handlers are listed in the Account Search handlers table.
Which record types a specialist can search is governed by the Account Type Setting
(MED_Account_Type_Setting__mdt) records, not by this integration. The delivered Employee record
has Include in Search and Allow Referred By, so a resolved representative can be selected
into Referred By without further configuration.
That record ships from the Medical Information Cloud - Setup plan, so an organization that has never used Employee accounts in Account Search may not have it. These are its delivered values:
| Field | Value |
|---|---|
| Account Record Type | MED_Employee |
| Include in Search | Checked |
| Allow Referred By | Checked |
| Is Person Record Type | Checked |
| Include in Create | Checked |
| Account Search Order | 3 |
| Segment | Default_Segment |
| Default for Search, Change Search Tab on Select, Allow Filter by Affiliation Search, Require Institution on Create | Unchecked |
Without it the representative still resolves and Referred By is still stamped on an inbound inquiry, but a specialist cannot search for or select an Employee account interactively.
Configuration the Setup plan does not backfill
The Medical Information Cloud - Setup plan is applied at install time. An organization that was installed before this release therefore does not receive anything the plan added for LSC, and none of it arrives with a package upgrade. Treat the delivered configuration as a starting point that a new install happens to get for free, not as something every org will have.
Every item below is required by one or more capabilities, ships from Setup only, and fails quietly when absent — nothing errors, so the symptom is a capability that resolves nothing. Work through the list before enabling the integration in an existing organization.
Setup-only configuration to verify or create
| Configuration | Needed for | Symptom if missing | Where to get the values |
|---|---|---|---|
IM_Connection__mdt, IM_Field_Mapping__mdt, and IM_Value_Mapping__mdt records | All three capabilities | The capability behaves as though the integration were not installed | Reference: the mappings Account Search expects and Reference: the inbound Inquiry sync configuration |
AFLS_Account_Search_Handler and AFLS_User_Search_Handler Interface Handler records | Account Search | LSC is never queried during a search | Step 5 — Enable the Account Search handlers |
AFLS_Account_Search and AFLS_User_Search values in the MED_Source global value set | Account Search | Resolved records save with an empty Source | What Medical Information Cloud stores |
Employee Account Type Setting record | Account Search (interactive) | A resolved representative cannot be searched for or selected in the UI | Step 5 — Enable the Account Search handlers |
| A permission set granting External Credential Principal Access | Account Search | Interactive searches warn that the search could not be completed | Step 4 — Grant the callout permission |
The AFLS_Connector Named Credential, AFLS_Connector_Cred External Credential, and
AFLS_Connector_IDP External Auth Identity Provider also ship from Setup. Unlike the items above they
fail loudly — the callout errors — so they are covered as part of
Configure the LSC connection rather than repeated here.
Creating and customizing the mappings
The Integration Mapping Connection, Integration Field Mapping, and Integration Value Mapping records described above are delivered by the Medical Information Cloud - Setup plan. That plan is applied at install time, so an organization that has already been installed does not receive newly added records from a later plan version — see Configuration the Setup plan does not backfill. In that situation, and whenever the delivered mapping does not match how your organization is configured, an administrator creates the records directly.
All three metadata types ship unprotected, so they can be created and edited in the target organization: in the Quick Find box in Setup, search for and select Custom Metadata Types, then click Manage Records next to the type you want.
The records below are the configuration view of the Integration Mapping module. For the Apex contracts the module exposes — the mapping service, the value-transformer extension point, and the data transfer objects a custom transform receives — see Integration Mapping.
Remote objects available to each capability
Remote Object is not free choice. Each capability queries a fixed set of remote objects, and a field mapping is only ever read if its Remote Object is one of them. Check this table before creating a mapping.
Remote objects by capability
| Capability | Connection Integration Type | Remote objects available |
|---|---|---|
| Inbound Inquiry sync | AFLS | InquiryQuestion ContactPointEmail ContactPointPhone ContactPointAddress |
| Account Search — requester | AFLS_Account_Search | HealthcareProvider Account ContactPointEmail ContactPointPhone ContactPointAddress |
| Account Search — submitting representative | AFLS_User_Search | User |
A mapping whose Remote Object is not in the list for its capability is silently ignored — it is never included in the remote query and never applied to a record. Nothing errors, and the mapping looks correct in Setup.
Reaching related records
The inbound sync queries InquiryQuestion as its single driver object, so Inquiry, Case, and
Account are not available as Remote Object values. Their fields are reached instead through dot
traversal on the Remote Path, with InquiryQuestion as the Remote Object:
| To read | Remote Object | Remote Path |
|---|---|---|
| The inquiry's account id | InquiryQuestion | Inquiry.AccountId |
| The inquiry's account name | InquiryQuestion | Inquiry.Account.Name |
| The parent case's origin | InquiryQuestion | Inquiry.Case.Origin |
| The parent case's id | InquiryQuestion | Inquiry.CaseId |
The same applies to the requester search, where the healthcare provider anchor reaches account fields as
Account.FirstName and Account.RecordType.DeveloperName.
There is no depth limit imposed by the integration beyond what the remote query language accepts, so any field reachable by a relationship path from the driver object can be mapped without adding a Remote Object.
The three ContactPoint objects are the exception: they are children of the requester's Account rather than of the driver object, so they cannot be reached by traversal and are fetched in a follow-up query. That is why they appear as Remote Objects in their own right.
What the three metadata types do
Integration Mapping Connection (mvn__IM_Connection__mdt) — one record per remote system and
capability. It stores the credential and the settings the callout uses.
Integration Mapping Connection fields
| Field | Required | Description |
|---|---|---|
| Integration Type | Yes | Selects which feature uses the connection — AFLS_Account_Search, AFLS_User_Search, or AFLS for the inbound pull. Code looks connections up by this value, so it must match exactly. |
| Connection Type | Yes | Default for a single connection per integration type. |
| Named Credential | The Named Credential the callout uses — AFLS_Connector for LSC. | |
| Active | The connection is ignored entirely until this is selected. | |
| Batch Size | Page size for remote queries. The delivered LSC records use 200. | |
| Call Timeout (ms) | Callout timeout. The delivered LSC records use 120000. | |
| API Version | Remote API version. Leave blank to use the default. | |
| Instance Identifier | Distinguishes multiple connections of the same integration type, for a customer with more than one LSC organization. | |
| Where Condition | Optional remote SOQL filter. Used by the inbound pull to narrow the driver query; not used by Account Search. |
Integration Field Mapping (mvn__IM_Field_Mapping__mdt) — one record per field, hanging off
a connection.
Integration Field Mapping fields
| Field | Required | Description |
|---|---|---|
| Connection | Yes | The Integration Mapping Connection this mapping belongs to. A mapping is only used by the capability that owns its connection. |
| Direction | Yes | Inbound brings a remote value into Medical Information Cloud. Outbound translates a Medical Information Cloud value back into a remote field — which is what allows a search filter on that field to be sent to LSC. Both does each. A field you only want to read needs Inbound; a field you want to filter a search on needs Outbound or Both. |
| Remote Object | Yes | The remote object the value comes from. Must be one of the objects the capability queries — see Remote objects available to each capability. A value outside that set is silently ignored. |
| Remote Path | The field on that object. Supports dot traversal for related records, for example Inquiry.Case.Origin or Account.RecordType.DeveloperName — which is how objects that are not available as a Remote Object are reached. | |
| Remote Data Type | Yes | String, Boolean, Date, DateTime, Decimal, Integer, or Picklist. Governs how the raw value is converted. |
| SF Object | Yes | The Medical Information Cloud object the value lands on. This is a lookup to the object list, not free text, and it controls which fields the next two lookups offer. |
| SF Field | The target field, chosen from the fields of SF Object. | |
| SF Compound Field | Used instead of SF Field for a compound field such as a Person Account name — for example Account.Name.FirstName. See the note below. | |
| SF Record Type | The developer name of the record type this mapping applies to, or All for every record type. This is how one connection maps to several targets at once. | |
| Transform Class | Optional Apex class implementing the Value Transformer Interface (mvn.IM_IValueTransformer), for a translation the field and value mappings cannot express. Leave blank unless you have written one. |
First and last name must be mapped through SF Compound Field (Account.Name.FirstName /
Account.Name.LastName), not SF Field. Person Account names are compound fields, and a
mapping that targets FirstName directly through SF Field will not resolve.
Integration Value Mapping (mvn__IM_Value_Mapping__mdt) — translates individual values for
one field mapping. Each record has a Field Mapping, a Remote Value, and a Salesforce
Value. This is how the LSC account type PersonAccount becomes the MED_HCP record type.
Add a field mapping
-
In the Quick Find box in Setup, search for and select Custom Metadata Types.
-
Click Manage Records next to Integration Field Mapping, then click New.
-
Enter a Label and Integration Field Mapping Name. The delivered records use a
AFLS_User_orAFLS_AcctSearch_prefix; any unique name works for records you create. -
Select the Connection for the capability the mapping serves.
-
Set Remote Object, Remote Path, and Remote Data Type to describe where the value comes from in LSC.
-
Set SF Object, then SF Field (or SF Compound Field), to describe where it lands.
-
Set SF Record Type to the record type developer name the mapping applies to, or
All. -
Set Direction —
Inboundto read the value,OutboundorBothif specialists need to filter searches on it. -
Click Save. No deployment or code change is required; the next search picks the mapping up.
To translate values as well as fields — for example a remote account type into a Medical Information Cloud record type — add Integration Value Mapping records pointing at the field mapping you just created.
Reference: the mappings Account Search expects
The tables below are the delivered configuration. Use them to recreate the mappings in an organization that will not receive them from the Setup plan, or as a model for your own.
Two required fields are constant across the two Account Search tables below and are therefore not
repeated in their columns: Remote Data Type is String on all of them, and Connection is
the connection named in each table's caption. Set both when creating a record. The inbound sync
mappings are listed separately, and their data type varies.
The SF Record Type column differs between the two tables for a reason. The requester search
determines the Contact Information record type from the remote ContactPoint object in code, so its
contact-point mappings use All. The representative search reads the record type from the mapping,
so its mappings name MED_Email, MED_Phone and MED_Address — and changing them there changes
where those records land.
LSC User Search connection (submitting representative)
| Remote Object | Remote Path | SF Object | SF Field | SF Record Type | Direction |
|---|---|---|---|---|---|
| User | Id | Account | MED_External_ID__c | MED_Employee | Inbound |
| User | FirstName | Account | compound Account.Name.FirstName | MED_Employee | Inbound |
| User | LastName | Account | compound Account.Name.LastName | MED_Employee | Inbound |
| User | CompanyName | Account | MED_Company__c | MED_Employee | Inbound |
| User | CountryCode | Account | MED_Country__c | MED_Employee | Inbound |
| User | Email | MED_Contact_Information__c | MED_Email__c | MED_Email | Inbound |
| User | Phone | MED_Contact_Information__c | MED_Phone__c | MED_Phone | Inbound |
| User | Street | MED_Contact_Information__c | MED_Address_Line_1__c | MED_Address | Inbound |
| User | City | MED_Contact_Information__c | MED_City__c | MED_Address | Inbound |
| User | StateCode | MED_Contact_Information__c | MED_State__c | MED_Address | Inbound |
| User | PostalCode | MED_Contact_Information__c | MED_Postal_Code__c | MED_Address | Inbound |
| User | CountryCode | MED_Contact_Information__c | MED_Country__c | MED_Address | Inbound |
LSC Account Search connection (healthcare providers and institutions)
| Remote Object | Remote Path | SF Object | SF Field | SF Record Type | Direction |
|---|---|---|---|---|---|
| HealthcareProvider | Account.Id | Account | MED_External_ID__c | MED_HCP | Inbound |
| HealthcareProvider | Account.FirstName | Account | compound Account.Name.FirstName | MED_HCP | Both |
| HealthcareProvider | Account.LastName | Account | compound Account.Name.LastName | MED_HCP | Both |
| HealthcareProvider | Account.RecordType.DeveloperName | Account | RecordTypeId | MED_HCP | Both |
| Account | Id | Account | MED_External_ID__c | MED_Institution | Inbound |
| Account | Name | Account | Name | MED_Institution | Inbound |
| Account | RecordType.DeveloperName | Account | RecordTypeId | MED_Institution | Both |
| ContactPointEmail | EmailAddress | MED_Contact_Information__c | MED_Email__c | All | Inbound |
| ContactPointPhone | TelephoneNumber | MED_Contact_Information__c | MED_Phone__c | All | Inbound |
| ContactPointAddress | Street | MED_Contact_Information__c | MED_Address_Line_1__c | All | Inbound |
| ContactPointAddress | City | MED_Contact_Information__c | MED_City__c | All | Inbound |
| ContactPointAddress | StateCode | MED_Contact_Information__c | MED_State__c | All | Inbound |
| ContactPointAddress | PostalCode | MED_Contact_Information__c | MED_Postal_Code__c | All | Inbound |
| ContactPointAddress | CountryCode | MED_Contact_Information__c | MED_Country__c | All | Both |
Value mappings on the LSC Account Search connection
| Field mapping | Remote Value | Salesforce Value |
|---|---|---|
| AFLS AcctSearch - Account Record Type | PersonAccount | MED_HCP |
| AFLS AcctSearch - Account Record Type | Business | MED_Institution |
| AFLS AcctSearch - Inst Account RT | Business | MED_Institution |
Map the bare remote state code (StateCode) rather than a composed value. Medical
Information Cloud composes the country and state into the ISO 3166-2 form (US-IL) that
MED_State__c requires, and decomposes it again when sending a state filter to LSC.
Optional: fall back to the account owner's country
When an LSC account has no address with a country, Medical Information Cloud can use the country of
the LSC account's owner instead. These mappings are not delivered; add them on the
AFLS_Account_Search connection to turn the fallback on.
| Remote Object | Remote Path | SF Object | SF Field | SF Record Type | Direction |
|---|---|---|---|---|---|
| HealthcareProvider | Account.Owner.CountryCode | Account | MED_Country__c | MED_HCP | Inbound |
| Account | Owner.CountryCode | Account | MED_Country__c | MED_Institution | Inbound |
- A country mapping whose remote path runs through
Owneris always treated as the last source: it is used only when the account's own country and its address yield nothing theMED_Countryvalue set includes. Any other mapping toMED_Country__ctakes precedence over the address. An owner mapping is never used to filter a search: a country criterion in Account Search does not match on the owner's country. User.CountryCodeexists only when State and Country/Territory Picklists are enabled in the LSC org. Add these mappings only if it is, because a mapped path that does not exist in LSC fails every Account Search query on the connection, not just the fallback.- The owner is usually the representative who manages the account, so the fallback records the representative's country, which is not necessarily the healthcare provider's.
- If the owner has no country, or one the
MED_Countryvalue set does not include, the account is rejected as described in What Medical Information Cloud stores.
Reference: the inbound Inquiry sync configuration
The inbound sync is delivered as a single connection, AFLS Medical Inquiry, with its own field
mappings onto the Inbound Form (MED_Inbound_Form__c) object.
LSC Medical Inquiry connection settings
| Field | Delivered value |
|---|---|
| Integration Type | AFLS |
| Connection Type | Default |
| Named Credential | AFLS_Connector |
| Active | Unselected — activate once the credential is authenticated |
| Batch Size | 200 |
| Call Timeout (ms) | 120000 |
| Where Condition | Inquiry.Status = 'New' |
The Where Condition filters the InquiryQuestion driver query through its parent inquiry, so
only inquiries in a New status are pulled. Adjust it to match the status your LSC process uses
to mark an inquiry ready for Medical Information. Leaving it blank pulls every InquiryQuestion
the credential can read, including ones already handled in LSC.
LSC Medical Inquiry field mappings
All of these are Inbound, target the Inbound Form (MED_Inbound_Form__c) object, and use
an SF Record Type of All. They use all four of the remote objects the sync makes available —
see Remote objects available to each capability.
| Remote Object | Remote Path | SF Field | Remote Data Type |
|---|---|---|---|
| InquiryQuestion | Id | MED_External_ID__c | String |
| InquiryQuestion | Question | MED_Inquiry_Text__c | String |
| InquiryQuestion | ProductReferenceRecord.Name | MED_Product__c | String |
| InquiryQuestion | Inquiry.AccountId | MED_Requester_External_ID__c | String |
| InquiryQuestion | Inquiry.Account.Name | MED_Requester_Name__c | String |
| InquiryQuestion | Inquiry.CreatedById | MED_Federation_Id__c | String |
| InquiryQuestion | Inquiry.CaseId | MED_Group_Identifier__c | String |
| InquiryQuestion | Inquiry.SubmittedDateTime | MED_Datetime_Submitted__c | DateTime |
| InquiryQuestion | Inquiry.Case.Origin | MED_Channel__c | Picklist |
| ContactPointEmail | EmailAddress | MED_Email__c | String |
| ContactPointPhone | TelephoneNumber | MED_Phone_Number__c | String |
| ContactPointAddress | Street | MED_Address_Line_1__c | String |
| ContactPointAddress | City | MED_City__c | String |
| ContactPointAddress | StateCode | MED_State__c | String |
| ContactPointAddress | PostalCode | MED_Postal_Code__c | String |
| ContactPointAddress | CountryCode | MED_Country__c | String |
ProductReferenceRecord is a polymorphic lookup — on InquiryQuestion it can point at more than
one kind of product record. Traversing it as ProductReferenceRecord.Name to read the product name
works, which is what the delivered mapping does. A custom mapping that needs the product name does not
have to resolve the record's type first or issue a second query for it.
The name that lands in MED_Product__c is then matched to a Medical Information Cloud product by the
standard Inbound Form product matching, described in Inbound Forms.
Four of these mappings do more than populate a field, and omitting them fails quietly rather than with an error:
Id→MED_External_ID__cis the deduplication key. A question whose mapping does not resolve this is skipped, and re-runs would otherwise create duplicates.Inquiry.AccountId→MED_Requester_External_ID__cis the value Account Search resolves to stamp the requester on the interaction.Inquiry.CreatedById→MED_Federation_Id__cis the LSC User Id of the submitting representative, which is what the User Search handler resolves into Referred By.Inquiry.CaseId→MED_Group_Identifier__cgroups the questions of one inquiry under a single interaction, and is half of the identifier the status writeback sends its update to. Without it each question becomes its own interaction and writeback can never address the LSC record — see How the interaction is matched back to LSC.
If the two external-id mappings are missing, the inbound sync still creates Inbound Forms and interactions, but the automatic account and representative resolution described under Account Search silently resolves nothing.
Do not add a field mapping for Channel Details (MED_Channel_Details__c). The pull stamps it with
the connection's developer name, but only when no mapping has already set it — so mapping it replaces
the value the integration depends on, and breaks three things at once:
- Grouping. Questions of one inquiry are grouped by Channel Details as well as Group Identifier.
- Writeback flagging. An interaction is recognized as LSC-originated by matching Channel Details against the active LSC connection developer names. A different value means nothing is ever flagged.
- Writeback routing. Channel Details becomes the prefix of the group identifier, which is what routes the update to the right LSC org.
The field is reserved by the integration. Leave it unmapped.
Inquiry.Case.Origin → MED_Channel__c ships with no value mappings, so LSC Case Origin values
are copied verbatim. Inquiry Management then copies that value onto the interaction's
Origin — a standard Salesforce picklist, which rejects a value it does not include.
Medical Information Cloud delivers Chat, Email, Fax, Follow-up, Mail, MIRF, Phone, and
Social. If your LSC org uses any other origin, the Inbound Form is created but the Interaction
fails to be created, and the error is written to Request Creation Log
(MED_Request_Creation_Log__c) on the form.
Add Integration Value Mapping records against the channel field mapping to translate each LSC origin into one your organization has — this is the single most common first-run failure for the inbound sync. See Add a field mapping for how value mappings are created.
How primary Contact Points are chosen
The Inbound Form (MED_Inbound_Form__c) is a flat staging record: it holds a single email, phone
and address in its own fields (MED_Email__c, MED_Phone_Number__c, MED_Address_Line_1__c and the
rest). Exactly one value per type can be stored, so the pull has to choose one — and the Primary
flag is how LSC expresses which one that is.
The pull therefore asks LSC only for Contact Points flagged Primary. Where an account has several primaries of the same type, the most recently modified one is used.
An LSC org does not enforce that an account has exactly one primary Contact Point per type — out of the box it enforces nothing at all. Two consequences follow:
- An account with no primary of a type contributes nothing for that type. If the requester's email is present in LSC but not flagged primary, the resulting Inbound Form has no email, and the interaction is created without it. The pull does not fall back to a non-primary record.
- An account with several primaries of a type is resolved by modification date, so the value that arrives can change as records are edited in LSC, without anything changing in Medical Information Cloud.
If requesters are arriving without contact details, check the Primary flags on the account's Contact Points in LSC before looking at the mappings.
Account Search does not work this way, because its target is not flat. It creates
Contact Information (MED_Contact_Information__c) records, which are children of the account and
therefore multi-valued — an account can have several emails, phones and addresses at once. So
The requester search retrieves every Contact Point per account and type and converts each into
its own Contact Information record, applying the primary flag to mark which one is primary rather than
to decide which one to keep.
One practical consequence: an interactive search can return contact details that the inbound pull skips, because the pull had only one field to put them in.
This applies to the requester search specifically. The representative search reads its contact
details from fields on the LSC User record, so it produces one email, one phone, and one address
regardless — see
What Medical Information Cloud stores.
How deduplication behaves
The pull skips any question whose External ID already exists on an Inbound Form. Two details follow from that:
-
The check is against every existing Inbound Form, whatever its status. A question that has already been pulled is never pulled again, even after its interaction is closed. To deliberately re-pull an inquiry, delete its Inbound Form first.
noteDeleting the Inbound Form does not remove the Interaction and Request it produced. Because the re-pulled form has the same group identifier, Inquiry Management matches the existing interaction and adds a new Request to it rather than creating a fresh interaction. If you want a clean interaction, delete or close the original as well.
-
MED_External_ID__cis unique and case-sensitive. If you write your own external-id mapping, make sure it produces a stable value with consistent casing — two values differing only in case are two different records to the dedupe check.
The delivered connection also includes one Outbound mapping, Case.Status → Case.Status, with
three value mappings that translate Medical Information Cloud statuses to LSC ones. Those belong to
the Case status writeback rather than the inbound pull; they share the
connection because they talk to the same LSC org.
Configuration that quietly disables a capability
The following gaps stop a capability from working without producing an error, so they are worth checking first when something resolves nothing. The last two are reference-data gaps rather than mapping gaps, and are the ones most likely to bite an organization that was installed before this release — see Configuration the Setup plan does not backfill.
-
No record type on the User Search Account mappings. The submitting-representative handler resolves its target record type from the mappings. If none is configured it makes no callout at all and resolves nothing — deliberately, because the alternative would be creating the representative under the Account default record type and polluting the org. Confirm the Account mappings on the
AFLS_User_Searchconnection have an SF Record Type —MED_Employeein the delivered configuration, or whichever record type you have retargeted them to. -
No record-type mapping on the Account anchor. The institution search needs the Account anchor's record-type mapping and its
Businessvalue mapping to constrain the query to business accounts. Without them the institution search is skipped and the search reports a warning, because an unconstrained query would also return person accounts and mis-stamp them as institutions. -
No usable country for an account. Where neither the LSC account, its address, nor its owner (if the owner mappings are added) supplies a country the
MED_Countryvalue set includes, the country is left blank and theMED_RequireCountryvalidation rejects the account. Medical Information Cloud logs a warning naming the account's LSC Id, but the specialist sees only "Country is required". Give the account an address with a country, or add the owner mappings — see Optional: fall back to the account owner's country. -
Missing
MED_Sourcevalues. A restricted picklist that does not include the connection's developer name means resolved records save with no Source. See What Medical Information Cloud stores.
Mapping to your own fields
To land an LSC value on a custom field, add a field mapping with SF Object and SF Field pointing at it. The target field must be writable by the user the search runs as — the specialist for an interactive search, and the Automated Process user for inbound resolution.
A value Medical Information Cloud cannot accept is dropped from the record and logged as a warning rather than failing the whole record, so a mapping that targets a restricted picklist or an Email field will silently omit values those fields reject. See Monitor and troubleshoot.
Schedule the pull
Register the schedule after authentication and mapping metadata are in place. There are three ways
to run the pull, all using the same mvn.MED_AflsInquiryPullSchedulable class from Developer
Console or an anonymous Apex window.
Hourly (the supplied convenience method)
mvn.MED_AflsInquiryPullSchedulable.scheduleHourlyJob();
This registers the job at the top of every hour (0 0 * * * ?) under the name AFLS Inquiry
Pull, and returns the scheduled job id. Hourly suits most organizations, which is why it is
provided as a single call.
To stop the schedule, delete the corresponding entry under Setup → Scheduled Jobs.
Any other interval
The class is schedulable in its own right, so you are not limited to hourly. Supply your own job name and cron expression:
System.schedule('AFLS Inquiry Pull - every 30 minutes', '0 0,30 * * * ?', new mvn.MED_AflsInquiryPullSchedulable());
For the cron format and the full list of Medical Information Cloud schedulable jobs, see Scheduling Apex jobs.
Each call to System.schedule creates a separate scheduled job. If you have already run
scheduleHourlyJob(), delete the AFLS Inquiry Pull entry under Setup → Scheduled Jobs
before registering a different interval, or both schedules will run.
Immediately, once
To pull now rather than waiting for the next scheduled run — after changing a mapping, for example, or to confirm the configuration works:
(new mvn.MED_AflsInquiryPullSchedulable()).execute(null);
The schedulable context is unused, so null is safe. This enqueues the same dispatcher a scheduled
run would.
Running the pull while a scheduled run is in flight does not create duplicate Inbound Forms.
Questions whose External ID (MED_External_ID__c) already exists are skipped, so the pull is
idempotent.
Only one schedule is required regardless of how many LSC connections are configured. Each run fans
out one pull per active IM_Connection__mdt record whose Integration Type is AFLS. Account
Search connections are not part of the scheduled pull; they are used on demand.
Searching more than one LSC organization
A customer connected to several LSC organizations can create an Integration Mapping Connection for each, using the same Integration Type and a distinct Developer Name (and, where useful, an Instance Identifier). Account Search queries every active search connection and merges the results.
If one organization cannot be reached, the others still return their results, and the search reports a warning rather than silently showing fewer results.
To tell the organizations apart on the resulting records, add each connection's developer name
to the MED_Source global value set. The Source field is stamped with the developer name of
the connection that resolved the record, so a second connection called, for example,
AFLS_User_Search_EU records that value rather than AFLS_User_Search.
MED_Source__c is a restricted picklist. If a connection's developer name is not an active value
in the MED_Source global value set, the source is not stamped — the record still saves, and a
warning is logged. Add the value before activating an additional connection, or resolved records
will be indistinguishable by source.
Account Search behavior worth knowing
Quick search results are ordered by relevance. A free-text search returns the closest matches first rather than ordering by record identifier.
A search that could not run says so. If the LSC organization is unreachable or the Named Credential is not authenticated, the search returns a warning. A specialist can tell "the search could not run" from "this person does not exist in LSC."
A representative who cannot be matched does not block the inquiry. If an inbound inquiry's submitting representative matches no LSC User, Referred By is left empty and the reason is logged. The interaction and request are still created.
Territory is not captured. The submitting representative's LSC territory is not stored in Medical Information Cloud in this release.
Free-text searches are capped per connection. Both searches return at most 200 matches per LSC connection, in relevance order, though by different means. For the requester search that is a cap on the candidates it hydrates, and the country filter is applied after the cap — so a broad term combined with a narrow country filter can return fewer matches than exist. Narrow the search term rather than relying on the filter to do the narrowing.
Not every filter operator can be sent to LSC. Filters are translated into the remote query, and only the operators the remote query language can express survive. An operator that cannot be translated is dropped and the search reports a warning, rather than being quietly turned into a different filter. The country filter supports Equals only.
Date and date/time filter values are not supported, and are dropped without a warning. Only text values are translated into the remote search. Unlike an unsupported operator, an unsupported value type produces no warning — the filter is simply not applied, so the search returns results wider than the specialist asked for. Treat a date filter as having no effect on LSC results.
Monitor and troubleshoot
-
Inbound Forms list view — Failed forms display an Error icon. Open the record or the Quick Action Errors utility item for the warning message.
warningThis only finds forms that were created and then failed downstream. A form the pull could not insert at all — because a mapped value the Inbound Form rejects made the whole record invalid — never becomes a record, so it does not appear in any list view. Its only trace is a Debug Log entry tagged
phase=pull. When the pull reports having processed inquiries that you cannot find, check the Debug Log rather than concluding the remote query returned nothing.Note the asymmetry with Account Search: the search paths drop an individual value the target field will not accept and save the rest of the record, but the inbound pull has no such per-field guard — one bad value fails the entire Inbound Form.
-
Debug Log records — The scheduled pull and the writeback log through the standard Medical Information Cloud logger, so their entries land on Debug Log (
mvn__Debug_Log__c). See How LSC entries are logged below for the format and for how Account Search entries differ, and Debug logs for how to change the log level. -
Rerun failed forms — After correcting mapping or reference data issues, use the Recreate Request or Mass Recreate Request quick actions documented in Inbound Forms — Troubleshooting.
Common causes of skipped or errored forms:
- Missing External ID mapping — A question row is skipped when the
mapping does not resolve
MED_External_ID__c. - Duplicate External ID — Forms whose external ID already exists are silently skipped (expected idempotent behavior).
- Inactive connection — Connections with Active unchecked are ignored by the dispatcher and by the search handlers.
- Callout failures — Verify the Named Credential, External Client App, and LSC Run As user permissions when REST queries return errors.
- No records returned rather than an error — A run that reports success and produces no Inbound Forms usually means the integration user cannot see the LSC Cases, not that there were none. Check Record-level access under private sharing.
How LSC entries are logged
Entries from the scheduled jobs — the inbound Inquiry pull and the status writeback — have a structured, filterable prefix, so one run can be isolated from everything else in the org:
[AFLS|dir=INBOUND|conn=AFLS_Medical_Inquiry|run=1753980000000-AFLS|src=MED_AflsInquiryPullServiceImpl|phase=query] <detail>
LSC log tag parts
| Part | Meaning |
|---|---|
dir | INBOUND for the Inquiry pull, OUTBOUND for the status writeback |
conn | The Integration Mapping Connection developer name, so a customer with several LSC orgs can tell which one a line came from |
run | A correlation id generated once per scheduled run — filter on this to follow one run end to end |
src | The class that emitted the entry |
phase | Where in the run it happened, for example the remote query or the mapping step |
Account Search entries do not have this prefix. The tag is produced by the scheduled pull and
writeback jobs only. The Account Search classes — including both handlers, the result mapper, and the
representative search service — log through a different path that records the emitting class name but
no AFLS prefix, no conn, and no run correlation id. There is therefore nothing to filter on
to group one interactive search, and that includes the automatic requester and representative
resolution that runs as an inbound form is processed.
To find Account Search entries, filter Message (mvn__Message__c) on the emitting class name
instead:
| Class | What it logs |
|---|---|
MED_AflsAccountSearchHdlr | Requester (HCP and institution) search: skipped connections, per-connection failures, candidate-cap notices |
MED_AflsUserSearchServiceImpl | Representative search: skipped connections, unresolved record types, dropped field values, unstamped Source |
MED_AflsAccountResultMapper | Requester result mapping: failed field mappings, dropped values, missing country |
MED_AflsQueryBuilder | Remote query construction for the representative search |
Correlating an interactive search therefore relies on the entry timestamps rather than a run id.
Two fields matter when reading these:
- Message (
mvn__Message__c) stores the tag and the beginning of the detail, capped at 255 characters. This is the field to filter or report on. - Body (
mvn__Body__c) stores the full, untruncated detail. Read Body before concluding an entry is incomplete — Message is only ever a summary.
How much is logged is governed by the Logger Settings (mvn__Logger_Settings__mdt) log level, not
by anything LSC-specific — there is no per-class or per-integration switch. Raise the level there
before reproducing a problem and lower it afterwards. See Debug logs.
One category of failure never reaches the Debug Log at all. When a Contact Information record is
rejected while being saved alongside its account, that failure is written with the platform's own
System.debug at FINEST — not through the Medical Information Cloud logger. Raising the
Logger Settings log level will not show it, because it never becomes a Debug Log
(mvn__Debug_Log__c) record.
The account still saves and the search still returns, so a missing email, phone, or address on an otherwise correct account leaves no trace in the place you would look for one. To capture it:
- In Setup, open Debug Logs and add a trace flag on the user the search runs as — the specialist for an interactive search, or the Automated Process user for inbound resolution.
- Set the Apex Code level to
FINESTon the debug level the trace flag uses. - Reproduce the search, then read the resulting Apex debug log — not the Debug Log object.
- Remove the trace flag afterwards;
FINESTproduces very large logs.
The value guards described under Creating and customizing the mappings are what keep this rare.
Common causes of unexpected Account Search results:
- Connection not active — An inactive search connection produces no results and no error; the handler behaves as though the integration were not installed.
- Missing namespace allowance — A callout failure reporting that the Named Credential might
not exist usually means
mvnis absent from Allowed Namespaces. - Account has no address with a country — The requester fails to save, often with a
bad value for restricted picklist fielderror. Give the account a primary Contact Point Address in LSC whose Country is a value inMED_Country— see Prerequisites. - A field value was skipped — A picklist value the org does not have, or an address that is not a valid email address, is dropped from the record and logged as a warning; the rest of the record still saves.
Related work items
- MIC-4337 — Scheduled inbound Inquiry pull engine
- MIC-4778 — LSC Named Credential and authentication
- MIC-4779 — Integration Connection and field mappings
- MIC-4725 — Account Search (epic)
- MIC-4816 — HCP and institution Account Search handler
- MIC-4826 — Submitting-rep User to Employee Account resolution
