[SOA]: Bugbash for releases 28.x - Contact unable to find due to Qasim map to Megan, different names#9263
[SOA]: Bugbash for releases 28.x - Contact unable to find due to Qasim map to Megan, different names#9263tomasevicst wants to merge 3 commits into
Conversation
Copilot PR ReviewIteration 3 · Outcome: completed Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630 Findings by domainFindings split into Knowledge-backed (cite a BCQuality article) and Agent (the agent's own judgement, no matching BCQuality rule).
Totals: 1 knowledge-backed · 0 agent findings. Orchestrator pre-filter (13 file(s) excluded)
Findings produced by the Copilot CLI agent against BCQuality at |
| if ContactList.RunModal() <> Action::LookupOK then | ||
| exit; | ||
| ContactList.GetRecord(SelectedContact); | ||
| if SelectedContact."E-Mail" <> '' then |
There was a problem hiding this comment.
In SelectContactAndUpdateEmail (the 'Use another contact always' flow), the sender's email is now written to Contact."E-Mail 2" instead of Contact."E-Mail".
Every read path that recognizes a contact by incoming sender address still filters exclusively on "E-Mail": GetContactsInvolvedInTask's Contact.SetFilter("E-Mail", From) (which feeds GetSecurityFiltersForContacts, the agent session's security/access filter), CreateContact's existing-contact check, SOAEmailMessage.Page.al, SOATaskMessage.Codeunit.al, and SOACreateTask.Page.al all match only on "E-Mail". No code in the app reads "E-Mail 2" for sender matching. As a result, choosing 'Use another contact always' silently stops working as 'always': the next incoming email from the same sender will no longer be recognized as belonging to this contact by the security filter or by any of the other lookup call sites, defeating the intent of the feature. Although emitted here as minor per agent-finding policy, the real-world impact is a functional/security-filter regression (major) and should be fixed before merge — either write the resolved address back to "E-Mail" as before, or update GetContactsInvolvedInTask (and the other E-Mail-based lookups) to also match against "E-Mail 2".
Agent judgement — not directly backed by a BCQuality knowledge article.
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why
… agent session on page open
| IsAgentSession := SOAKPITrackAll.IsOrderTakerAgentSession(AgentTaskID); | ||
| end; | ||
|
|
||
| trigger OnAfterGetRecord() |
There was a problem hiding this comment.
PopulateMappedEmail runs from the page's OnAfterGetRecord trigger, so it executes once per rendered Contact List row when an order-taker agent session is active.
Each invocation issues up to two FindFirst round-trips (SOA Task Contact Override, then conditionally SOA Email) against tables that grow unboundedly with agent email volume, producing the classic per-row N+1 pattern the referenced guidance flags. SetLoadFields is already applied correctly on both reads, which limits the cost per round-trip but not the round-trip count itself. Consider whether the mapped-email lookup can be resolved with a single joined/keyed read, or cached per AgentTaskID across rows, to avoid two extra queries per displayed contact.
Knowledge:
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why
Issue
Bug #640657: Agent unable to find mapped contacts in Contact List
When an agent maps an unknown sender email to a contact using the "Use another contact once" option, the mapping is stored in the SOATaskContactOverride table but remains invisible in the Contact List. This prevents agents from discovering the contact-to-email relationship and finding the correct contact when browsing the list.
Root Cause
The Contact List page did not expose:
Agents had no visibility into these mappings, making it difficult to find contacts by their mapped email addresses.
Solution
Enhanced the Contact List page with new fields visible only during agent sessions:
Changes Made
User Experience Impact
Before
After
Backward Compatibility
✓ Fully backward compatible — No breaking changes
What & why
Linked work
Fixes AB#640657
How I validated this
What I tested and the outcome (required — be specific: scenarios, commands, screenshots for UI changes)
Risk & compatibility