---
id: object/codeunit/1630
type: object
title: Codeunit 1630 "Office Management"
summary: Codeunit 1630 "Office Management" in Base Application (Microsoft.CRM.Outlook). 36 public procedures, 1 events, 3 event subscribers. Present since at least BC23, still in BC30, changed in BC24, BC27.
tier: official
language: en
tags:
  - codeunit
  - base application
versions:
  introduced: null
  last_changed: "27"
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-11T00:31:51.816Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: 6bd8778342af2085c3aaee65a03a33c7c841fe1a848430b2bf0fcf240a733cfe
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/CRM/Outlook/OfficeManagement.Codeunit.al
    title: src/Layers/W1/BaseApp/CRM/Outlook/OfficeManagement.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
object_type: codeunit
object_id: 1630
name: Office Management
namespace: Microsoft.CRM.Outlook
app: Base Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "24"
  - "27"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 47
  events: 1
  subscribers: 3
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 15
  called_by: 56
  implements: 0
---

# Codeunit 1630 "Office Management"

> Codeunit 1630 "Office Management" in Base Application (Microsoft.CRM.Outlook). 36 public procedures, 1 events, 3 event subscribers. Present since at least BC23, still in BC30, changed in BC24, BC27.

Base Application · Microsoft.CRM.Outlook · BC23-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/CRM/Outlook/OfficeManagement.Codeunit.al) · facts from BC29

## Events published

- `OnGetExternalHandlerCodeunit(OfficeAddinContext: Record "Office Add-in Context"; HostType: Text; var HandlerCodeunit: Integer)` (integration)

## Event subscriptions

- OnDeleteContact subscribes to Table "Contact" OnAfterDeleteEvent
- OnChangeCompany subscribes to Codeunit "System Action Triggers" ChangeCompany
- OnBeforeDownloadPdfAttachment subscribes to Codeunit "Mail Management" OnBeforeDownloadPdfAttachment

## Procedures

- `InitializeHost(NewOfficeHost: DotNet OfficeHost; NewHostType: Text)`
- `InitializeContext(TempNewOfficeAddinContext: Record "Office Add-in Context" temporary)`
- `AddRecipient(Name: Text[100]; Email: Text[80])`
- `AttachAvailable(): Boolean`
- `AttachDocument(AttachmentStream: Instream; AttachmentName: Text; BodyText: Text; Subject: Text)`
- `AttachDocument(BodyText: Text; Subject: Text)`
- `ChangeCompany(NewCompany: Text)`
- `ChangeCompanyWithPrompt(NewCompany: Text; Prompt: Text): Boolean`
- `CheckForExistingInvoice(CustNo: Code[20]): Boolean`
- `CloseEnginePage()`
- `DisplayOCRUploadSuccessMessage(UploadedDocumentCount: Integer)`
- `DisplayIncomingDocumentUploadSuccessMessage(UploadedDocumentCount: Integer)`
- `DisplayAttachmentUploadSuccessMessage(UploadedDocumentCount: Integer)`
- `DisplaySuccessMessage(var ExchangeObject: Record "Exchange Object")`
- `GetContact(var Contact: Record Contact; LinkToNo: Code[20]): Boolean`
- `GetContext(var TempOfficeAddinContext: Record "Office Add-in Context" temporary)`
- `GetEmailBody(OfficeAddinContext: Record "Office Add-in Context"): Text`
- `GetFinancialsDocument(): Text`
- `EmailHasAttachments(): Boolean`
- `InitiateSendToOCR(VendorNumber: Code[20])`
- `InitiateSendToIncomingDocumentsWithPurchaseHeaderLink(PurchaseHeader: Record "Purchase Header"; VendorNumber: Code[20])`
- `InitiateSendToIncomingDocuments(VendorNumber: Code[20])`
- `InitiateSendToAttachments(RecRef: RecordRef)`
- `InitiateSendApprovalRequest(VendorNumber: Code[20])`
- `IsAvailable(): Boolean`
- `IsOutlookMobileApp(): Boolean`
- `IsPopOut(): Boolean`
- `OCRAvailable(): Boolean`
- `SelectAndChangeCompany(): Text`
- `SendApprovalRequest(var IncomingDocument: Record "Incoming Document")`
- `SendToIncomingDocument(var TempExchangeObject: Record "Exchange Object" temporary; var IncomingDocument: Record "Incoming Document"; var IncomingDocAttachment: Record "Incoming Document Attachment"): Boolean`
- `SendToAttachments(var TempExchangeObject: Record "Exchange Object" temporary): Boolean`
- `SendToOCR(var IncomingDocument: Record "Incoming Document")`
- `StoreValue(Name: Text; Value: Text)`
- `GetOfficeAddinTelemetryCategory(): Text`
- `SaveEmailBodyHTML(OutputFileName: Text; HTMLText: Text)`

Plus 7 local procedures.

## Calls

From the extracted call graph of BC29 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an `Object::"Name"` argument. Interface dispatch and calls through events are not counted, so the list is not complete.

- [Codeunit 1631 "Office Host Management"](../codeunit/1631.md) (18 calls: `CloseEnginePage → CloseCurrentPage`, `EmailHasAttachments → EmailHasAttachments`, `GetContext → GetTempOfficeAddinContext`, …)
- [Codeunit 1629 "Office Attachment Manager"](../codeunit/1629.md) (6 calls: `AttachDocument → Add`, `AttachDocument → Done`, `AttachDocument → GetBody`, …)
- [Codeunit 419 "File Management"](../codeunit/419.md) (3 calls: `AttachDocument → GetExtension`, `AttachDocument → ServerTempFileName`, `GetContent → BLOBImportFromServerFile`)
- [Page 1626 "Office OCR Incoming Documents"](../page/1626.md) (3 calls: `InitiateSendApprovalRequest → (object)`, `InitiateSendToIncomingDocuments → (object)`, `InitiateSendToOCR → (object)`)
- [Codeunit 1535 "Approvals Mgmt."](../codeunit/1535.md) (2 calls: `SendApprovalRequest → CheckIncomingDocApprovalsWorkflowEnabled`, `SendApprovalRequest → OnSendIncomingDocForApproval`)
- [Codeunit 10 "Type Helper"](../codeunit/10.md) (1 call: `InitializeContext → NewLine`)
- [Codeunit 134 "Import Attachment - Inc. Doc."](../codeunit/134.md) (1 call: `SendToIncomingDocument → ImportAttachment`)
- [Codeunit 1638 "Office Jobs Handler"](../codeunit/1638.md) (1 call: `GetHandlerCodeunit → IsJobsHostType`)
- [Codeunit 1640 "Add-in Deployment Helper"](../codeunit/1640.md) (1 call: `InitializeContext → CheckVersion`)
- [Codeunit 4100 "Temp Blob"](../codeunit/4100.md) (1 call: `GetContent → CreateInStream`)
- [Codeunit 4110 "Base64 Convert"](../codeunit/4110.md) (1 call: `GetContent → ToBase64`)
- [Codeunit 50 "SaaS Log In Management"](../codeunit/50.md) (1 call: `ChangeCompanyWithPrompt → ShouldShowTermsAndConditions`)
- [Codeunit 500 "Enum Assignment Management"](../codeunit/500.md) (1 call: `InitiateSendToIncomingDocumentsWithPurchaseHeaderLink → GetPurchIncomingDocumentType`)
- [Page 1604 "Office New Contact Dlg"](../page/1604.md) (1 call: `OnDeleteContact → (object)`)
- [Page 2021 "Office Attachments"](../page/2021.md) (1 call: `InitiateSendToAttachments → (object)`)

## Called by

- [Codeunit 1637 "Office Document Handler"](../codeunit/1637.md) (15 calls: `DisableSuggestedLinesOnDisableMessage → GetOfficeAddinTelemetryCategory`, `GenerateLinesForDocument → GetContext`, `GenerateLinesForDocument → GetEmailBody`, …)
- [Codeunit 1636 "Office Contact Handler"](../codeunit/1636.md) (5 calls: `ChangeCompanyAndShowContact → ChangeCompanyWithPrompt`, `OnContactSelected → AddRecipient`, `OnContactSelected → GetContext`, …)
- [Page 1173 "Document Attachment Details"](../page/1173.md) (4 calls: `InitiateAttachFromEmail → InitiateSendToAttachments`, `OnAfterGetCurrRecord → IsAvailable`, `OnAfterGetCurrRecord → IsPopOut`, …)
- [Page 1178 "Doc. Attachment List Factbox"](../page/1178.md) (4 calls: `InitiateAttachFromEmail → InitiateSendToAttachments`, `OnInit → IsAvailable`, `UpdateActionsVisibility → IsAvailable`, …)
- [Page 1600 "Outlook Mail Engine"](../page/1600.md) (4 calls: `OnOpenPage → CloseEnginePage`, `OnOpenPage → InitializeContext`, `OnOpenPage → InitializeHost`, …)
- [Page 1626 "Office OCR Incoming Documents"](../page/1626.md) (4 calls: `onSave → DisplaySuccessMessage`, `onSave → SendApprovalRequest`, `onSave → SendToIncomingDocument`, …)
- [Page 26 "Vendor Card"](../page/26.md) (4 calls: `ActivateFields → IsAvailable`, `ActivateIncomingDocumentsFields → EmailHasAttachments`, `ActivateIncomingDocumentsFields → OCRAvailable`, …)
- [Page 51 "Purchase Invoice"](../page/51.md) (4 calls: `OnOpenPage → IsAvailable`, `OnOpenPage → IsOutlookMobileApp`, `OnOpenPage → OCRAvailable`, …)
- [Table 60 "Document Sending Profile"](../table/60.md) (4 calls: `LookupProfile → AttachAvailable`, `LookupProfile → IsAvailable`, `LookUpProfileVendor → AttachAvailable`, …)
- [Codeunit 1639 "Office Line Generation"](../codeunit/1639.md) (3 calls: `CreateLineItemsOnCloseSuggestedLineItems → GetOfficeAddinTelemetryCategory`, `CreateLinesBasedOnItemReferences → GetOfficeAddinTelemetryCategory`, `CreateLinesBasedOnQuantityReferences → GetOfficeAddinTelemetryCategory`)
- [Codeunit 1016 "Jobs-Send"](../codeunit/1016.md) (2 calls: `ConfirmSend → AttachAvailable`, `ConfirmSend → IsAvailable`)
- [Codeunit 1017 "Job Tasks-Send"](../codeunit/1017.md) (2 calls: `ConfirmSend → AttachAvailable`, `ConfirmSend → IsAvailable`)
- [Codeunit 260 "Document-Mailing"](../codeunit/260.md) (2 calls: `EmailFileInternal → AttachAvailable`, `EmailFileInternal → AttachDocument`)
- [Codeunit 79 "Sales-Post and Send"](../codeunit/79.md) (2 calls: `ConfirmPostAndSend → AttachAvailable`, `ConfirmPostAndSend → IsAvailable`)
- [Page 1832 "Outlook Individual Deployment"](../page/1832.md) (2 calls: `OnOpenPage → GetOfficeAddinTelemetryCategory`, `SendEmail → GetOfficeAddinTelemetryCategory`)
- [Page 2021 "Office Attachments"](../page/2021.md) (2 calls: `onSave → DisplaySuccessMessage`, `onSave → SendToAttachments`)
- [Page 43 "Sales Invoice"](../page/43.md) (2 calls: `OnOpenPage → CheckForExistingInvoice`, `PostDocument → IsAvailable`)
- [Table 5050 "Contact"](../table/5050.md) (2 calls: `ShowResultForCustomer → IsAvailable`, `ShowResultForVendor → IsAvailable`)
- [Codeunit 1034 "Job Planning Line - Calendar"](../codeunit/1034.md) (1 call: `CreateAndSend → GetOfficeAddinTelemetryCategory`)
- [Codeunit 1294 "OCR Service Mgt."](../codeunit/1294.md) (1 call: `UploadFile → IsAvailable`)
- [Codeunit 1304 "Sales-Quote to Invoice Yes/No"](../codeunit/1304.md) (1 call: `OnRun → AttachAvailable`)
- [Codeunit 5922 "Serv-Quote to Order (Yes/No)"](../codeunit/5922.md) (1 call: `ShowCreatedOrder → AttachAvailable`)
- [Codeunit 763 "Aged Acc. Receivable"](../codeunit/763.md) (1 call: `UpdateStatusText → IsAvailable`)
- [Codeunit 80 "Sales-Post"](../codeunit/80.md) (1 call: `SendPostedDocumentRecord → IsAvailable`)
- [Codeunit 83 "Sales-Quote to Order (Yes/No)"](../codeunit/83.md) (1 call: `ShowCreatedOrder → AttachAvailable`)
- [Page 132 "Posted Sales Invoice"](../page/132.md) (1 call: `OnOpenPage → IsAvailable`)
- [Page 134 "Posted Sales Credit Memo"](../page/134.md) (1 call: `OnOpenPage → IsAvailable`)
- [Page 138 "Posted Purchase Invoice"](../page/138.md) (1 call: `OnOpenPage → IsAvailable`)
- [Page 140 "Posted Purchase Credit Memo"](../page/140.md) (1 call: `OnOpenPage → IsAvailable`)
- [Page 142 "Posted Sales Shipments"](../page/142.md) (1 call: `OnOpenPage → IsAvailable`)
- [Page 143 "Posted Sales Invoices"](../page/143.md) (1 call: `OnOpenPage → IsAvailable`)
- [Page 144 "Posted Sales Credit Memos"](../page/144.md) (1 call: `OnOpenPage → IsAvailable`)
- [Page 145 "Posted Purchase Receipts"](../page/145.md) (1 call: `OnOpenPage → IsAvailable`)
- [Page 146 "Posted Purchase Invoices"](../page/146.md) (1 call: `OnOpenPage → IsAvailable`)
- [Page 147 "Posted Purchase Credit Memos"](../page/147.md) (1 call: `OnOpenPage → IsAvailable`)
- [Page 1604 "Office New Contact Dlg"](../page/1604.md) (1 call: `OnOpenPage → GetContext`)
- [Page 21 "Customer Card"](../page/21.md) (1 call: `OnOpenPageFunc → IsAvailable`)
- [Page 22 "Customer List"](../page/22.md) (1 call: `OnOpenPage → IsAvailable`)
- [Page 233 "Apply Vendor Entries"](../page/233.md) (1 call: `OnOpenPage → IsAvailable`)
- [Page 234 "Apply Employee Entries"](../page/234.md) (1 call: `OnOpenPage → IsAvailable`)
- [Page 41 "Sales Quote"](../page/41.md) (1 call: `OnOpenPage → IsAvailable`)
- [Page 42 "Sales Order"](../page/42.md) (1 call: `OnOpenPage → IsAvailable`)
- [Page 434 "Reminder"](../page/434.md) (1 call: `OnOpenPage → IsAvailable`)
- [Page 44 "Sales Credit Memo"](../page/44.md) (1 call: `PostDocument → IsAvailable`)
- [Page 5050 "Contact Card"](../page/5050.md) (1 call: `OnOpenPage → IsAvailable`)
- [Page 52 "Purchase Credit Memo"](../page/52.md) (1 call: `OnOpenPage → IsAvailable`)
- [Page 9300 "Sales Quotes"](../page/9300.md) (1 call: `OnOpenPage → IsAvailable`)
- [Page 9305 "Sales Order List"](../page/9305.md) (1 call: `OnOpenPage → IsAvailable`)
- [Page 9309 "Purchase Credit Memos"](../page/9309.md) (1 call: `OnOpenPage → IsAvailable`)
- [Report 190 "Issue Reminders"](../report/190.md) (1 call: `OnInitReport → IsAvailable`)
- and 6 more: data/code/graph/29/calls.json

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC24, BC27

Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).

## Ask your agent

Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: `bcatlas_resolve_node(object_type: "codeunit", object_name: "Office Management")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
