Skip to content

MngGetLeadsListByDesk

MngGetLeadsListByDesk returns a compact lead list for CRM selectors, calendar links, note links, assignment screens, and other UI controls that need to reference a lead without loading the full lead table.

The method is desk-scoped by the backend. The frontend does not pass deskFilter; the server reads the current manager from the session access object and uses the manager's cached desks mask.

SEO Summary

Use MngGetLeadsListByDesk when a CRM frontend needs a lightweight lead dropdown or autocomplete source filtered by manager desk permissions. The response includes lead id, full name, and masked email only, reducing payload size and avoiding exposure of full contact data in list selectors.

Access Control

🛡️ Access Level Required: SESSION_MANAGER, SESSION_ADMIN, SESSION_DEALER, SESSION_CRM_MANAGER, SESSION_CRM_ADMIN

Backend Scope Rules

The backend resolves access in this order:

  1. Read manager_id from data.__access.id.
  2. Load ManagerRecord from StaffManager cache.
  3. Use ManagerRecord.desks as the lead desk wildcard mask.
  4. Return only leads whose lead.desk matches that mask.

If manager.desks is empty, the method returns an empty rows array.

No request-provided deskFilter is accepted for this method. This prevents the client from widening CRM visibility beyond the current manager session scope.

Request Parameters

Name Type Required Description
__access object Yes Session access object injected by backend/session layer

Request Example

{
  "command": "MngGetLeadsListByDesk",
  "extID": "1",
  "data": {}
}

Response Schema

Name Type Description
structure string[] Column names for row values
rows array[] Lead rows using structure order

Row Fields

Field Type Description
lead_id int Lead id
full_name string Lead full name
email string Masked lead email

Response Example

{
  "structure": ["lead_id", "full_name", "email"],
  "rows": [
    [1001, "Anna Lead", "a***@example.com"],
    [1002, "Mark Prospect", "m***@example.com"]
  ]
}

Notes

  • Email is masked with the same masking helper used by CRM lead list responses.
  • This method is intended for lightweight selectors, not for table views.
  • For paginated table views with custom filters, use MngGetLeadsByFilter.
  • Desk access comes from cached manager configuration, so changes to ManagerRecord.desks affect future calls without requiring a frontend-provided filter.