---
id: object/codeunit/5180
type: object
title: Codeunit 5180 "Contoso CRM"
summary: Codeunit 5180 "Contoso CRM" in ContosoCoffeeDemoDataset (Microsoft.DemoTool.Helpers). 34 public procedures. Introduced in BC29, still in BC30.
tier: official
language: en
tags:
  - codeunit
  - contosocoffeedemodataset
versions:
  introduced: "29"
  last_changed: null
  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: e887899e54812eb2f40667a04ec84a70ac73cc36b8ec365819dbb2b209c6027a
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/ContosoCoffeeDemoDataset/app/DemoTool/Contoso%20Helpers/ContosoCRM.Codeunit.al
    title: src/Apps/W1/ContosoCoffeeDemoDataset/app/DemoTool/Contoso Helpers/ContosoCRM.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: 5180
name: Contoso CRM
namespace: Microsoft.DemoTool.Helpers
app: ContosoCoffeeDemoDataset
extends: null
first_version: "29"
last_version: "30"
present_in:
  - "29"
  - "30"
changed_in: []
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 34
  events: 0
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 0
  called_by: 27
  implements: 0
---

# Codeunit 5180 "Contoso CRM"

> Codeunit 5180 "Contoso CRM" in ContosoCoffeeDemoDataset (Microsoft.DemoTool.Helpers). 34 public procedures. Introduced in BC29, still in BC30.

ContosoCoffeeDemoDataset · Microsoft.DemoTool.Helpers · BC29-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/ContosoCoffeeDemoDataset/app/DemoTool/Contoso%20Helpers/ContosoCRM.Codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| Permissions | tabledata "Duplicate Search String Setup" = rim, tabledata "Interaction Group" = rim, tabledata "Interaction Template" = rim, tabledata "Interaction Template Setup" = rim, tabledata "Interaction Tmpl. Language" = rim, tabledata "Marketing Setup" = rim, tabledata Activity = rim, tabledata "Activity S... |

## Procedures

- `SetOverwriteData(Overwrite: Boolean)`
- `InsertDuplicateSearchStringSetup(FieldNo: Integer; PartOfField: Option; Length: Integer)`
- `InsertInteractionGroup(Code: Code[10]; Description: Text[100])`
- `InsertInteractionTemplate(Code: Code[10]; InteractionGroupCode: Code[10]; Description: Text[100]; UnitCostLCY: Decimal; UnitDurationMin: Decimal; InformationFlow: Integer; InitiatedBy: Integer; CorrespondenceTypeDefault: Enum "Correspondence Type"; WizardAction: Enum "Interaction Template Wizard Action"; IgnoreContactCorresType: Boolean)`
- `InsertInteractionTemplateSetup(SalesInvoices: Code[10]; SalesCrMemo: Code[10]; SalesOrdCnfrmn: Code[10]; SalesQuotes: Code[10]; PurchInvoices: Code[10]; PurchCrMemos: Code[10]; PurchOrders: Code[10]; PurchQuotes: Code[10]; EMails: Code[10]; CoverSheets: Code[10]; OutgCalls: Code[10]; SalesBlnktOrd: Code[10]; ServOrdPost: Code[10]; SalesShptNote: Code[10]; SalesStatement: Code[10]; SalesRmdr: Code[10]; ServOrdCreate: Code[10]; PurchBlnktOrd: Code[10]; PurchRcpt: Code[10]; SalesReturnOrder: Code[10]; SalesReturnReceipt: Code[10]; SalesFinanceChargeMemo: Code[10]; PurchReturnShipment: Code[10]; PurchReturnOrdCnfrmn: Code[10]; MeetingInvitation: Code[10]; EMailDraft: Code[10]; SalesDraftInvoices: Code[10])`
- `InsertInteractionTmplLanguage(InteractionTemplateCode: Code[10]; LanguageCode: Code[10])`
- `InsertSalesCycle(SalesCycleCode: Code[10]; Description: Text[100]; ProbabilityCalculation: Integer)`
- `InsertMarketingSetup(CountryOrRegionCode: Code[10]; ContactNos: Code[20]; CampaignNos: Code[20]; SegmentNos: Code[20]; ToDoNos: Code[20]; OpportunityNos: Code[20]; BusRelCodeForCustomers: Code[10]; BusRelCodeForVendors: Code[10]; BusRelCodeForBankAccs: Code[10]; BusRelCodeForEmployees: Code[10]; InheritSalespersonCode: Boolean; InheritTerritoryCode: Boolean; InheritCountryRegionCode: Boolean; InheritLanguageCode: Boolean; InheritAddressDetails: Boolean; InheritCommunicationDetails: Boolean; DefaultLanguageCode: Code[10]; DefaultSalesCycleCode: Code[10]; AttachmentStorageType: Enum "Setup Attachment Storage Type"; AutosearchForDuplicates: Boolean; SearchHitPercentage: Integer; MaintainDuplSearchStrings: Boolean; MergefieldLanguageID: Integer; DefCompanySalutationCode: Code[10]; DefaultPersonSalutationCode: Code[10]; DefaultCorrespondenceType: Enum "Correspondence Type"; InheritFormatRegion: Boolean)`
- `InsertActivity(Code: Code[10]; Description: Text[100])`
- `InsertActivityStep(ActivityCode: Code[10]; StepNo: Integer; Type: Enum "Task Type"; Description: Text[100]; Priority: Integer; DateFormula: Text)`
- `InsertBusinessRelation(Code: Code[10]; Description: Text[100])`
- `InsertSalutations(Code: Code[10]; Description: Text[100])`
- `InsertCampaign(No: Code[20]; Description: Text[100]; StartingDate: Date; EndingDate: Date; SalespersonCode: Code[20]; NoSeries: Code[20]; StatusCode: Code[10])`
- `InsertCampaignStatus(Code: Code[10]; Description: Text[100])`
- `InsertCloseOpportunityCode(Code: Code[10]; Description: Text[100]; Type: Option)`
- `InsertIndustryGroup(Code: Code[10]; Description: Text[100])`
- `InsertJobResponsibility(Code: Code[10]; Description: Text[100])`
- `InsertMailingGroup(Code: Code[10]; Description: Text[100])`
- `InsertTerritory(Code: Code[10]; Name: Text[50])`
- `InsertSalespersonPurchaser(Code: Code[20]; Name: Text[50]; CommissionPercentage: Decimal; Picture: Codeunit "Temp Blob"; EMail: Text[80])`
- `InsertWordTemplate(Code: Code[30]; Name: Text[250]; TableID: Integer; FileName: Text; LanguageCode: Code[10])`
- `InsertWebSource(Code: Code[10]; Description: Text[100]; URL: Text[250])`
- `InsertOrganizationalLevel(Code: Code[10]; Description: Text[100])`
- `InsertTeam(Code: Code[10]; Name: Text[50])`
- `InsertSalesCycleStage(SalesCycleCode: Code[10]; Stage: Integer; Description: Text[100]; CompletedPercent: Decimal; ActivityCode: Code[10]; QuoteRequired: Boolean; AllowSkip: Boolean; ChancesofSuccessPercent: Decimal)`
- `InsertSegmentHeader(No: Code[20]; Description: Text[100]; SalespersonCode: Code[20]; CorrespondenceType: Enum "Correspondence Type"; InteractionTemplateCode: Code[10]; UnitCost: Decimal; UnitDuration: Decimal; InteractionGroupCode: Code[10]; InformationFlow: Integer; InitiatedBy: Integer; IgnoreContactCorresType: Boolean)`
- `InsertSegmentLine(SegmentNo: Code[20]; LineNo: Integer; ContactNo: Code[20])`
- `InsertOpportunity(No: Code[10]; Description: Text[100]; SalespersonCode: Code[20]; ContactNo: Code[20]; ContactCompanyNo: Code[20]; SalesCycleCode: Code[10]; CreationDate: Date; Status: Enum "Opportunity Status"; Priority: Enum "Opportunity Priority"; Closed: Boolean; DateClosed: Date; NoSeries: Code[20])`
- `InsertOpportunityEntry(EntryNo: Integer; OpportunityNo: Code[10]; SalesCycleStage: Integer; EstimatedCloseDate: Date; DateofChange: Date; Active: Boolean; DateClosed: Date; ActionTaken: Integer; EstimatedValueLCY: Decimal; CompletedPercent: Decimal; ChancesofSuccessPercent: Decimal; CloseOpportunityCode: Code[10]; PreviousSalesCycleStage: Integer)`
- `InsertProfileQuestionnaireHeader(Code: Code[20]; Description: Text[250]; ContactType: Enum "Profile Questionnaire Contact Type"; BusinessRelationCode: Code[10])`
- `InsertProfileQuestionnaireLine(ProfileQuestionnaireCode: Code[20]; LineNo: Integer; Type: Enum "Profile Questionnaire Line Type"; Description: Text[250]; MultipleAnswers: Boolean; Priority: Enum "Profile Answer Priority"; AutoContactClassification: Boolean; ClassificationFieldsCust: Enum "Profile Quest. Cust. Class. Field"; StartingDateFormula: Text[30]; EndingDateFormula: Text[30]; ClassificationMethod: Integer; SortingMethod: Integer; FromValue: Decimal; ToValue: Decimal)`
- `InsertSalutationFormula(SalutationCode: Code[10]; LanguageCode: Code[10]; SalutationType: Enum "Salutation Formula Salutation Type"; Salutation: Text[50]; Name1: Enum "Salutation Formula Name"; Name2: Enum "Salutation Formula Name"; Name3: Enum "Salutation Formula Name")`
- `InsertContactJobResponsibility(ContactNo: Code[20]; JobResponsibilityCode: Code[10])`
- `FindContactNo(LinkToTable: Enum "Contact Business Relation Link To Table"; ContactBusinessRelationNo: Code[20]; ContactType: Integer): Code[20]`

## Called by

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 5385 "Create Interaction Template"](../codeunit/5385.md) (3 calls: `CreateInteractionTemplateLanguages → InsertInteractionTmplLanguage`, `CreateInteractionTemplates → InsertInteractionTemplate`, `OnRun → InsertInteractionTemplateSetup`)
- [Codeunit 5676 "Create Segment"](../codeunit/5676.md) (3 calls: `OnRun → FindContactNo`, `OnRun → InsertSegmentHeader`, `OnRun → InsertSegmentLine`)
- [Codeunit 5678 "Create Opportunity"](../codeunit/5678.md) (3 calls: `OnRun → FindContactNo`, `OnRun → InsertOpportunity`, `OnRun → InsertOpportunityEntry`)
- [Codeunit 5681 "Create Profile Questionnaire"](../codeunit/5681.md) (2 calls: `OnRun → InsertProfileQuestionnaireHeader`, `OnRun → InsertProfileQuestionnaireLine`)
- [Codeunit 5683 "Create Cont Job Responsibility"](../codeunit/5683.md) (2 calls: `UpdateCustomerContactJobResposibility → InsertContactJobResponsibility`, `UpdateVendorContactJobResposibility → InsertContactJobResponsibility`)
- [Codeunit 5235 "Create Web Source"](../codeunit/5235.md) (1 call: `OnRun → InsertWebSource`)
- [Codeunit 5305 "Create Territory"](../codeunit/5305.md) (1 call: `OnRun → InsertTerritory`)
- [Codeunit 5329 "Create Business Relation"](../codeunit/5329.md) (1 call: `OnRun → InsertBusinessRelation`)
- [Codeunit 5351 "Create Dup. Search Str. Setup"](../codeunit/5351.md) (1 call: `OnRun → InsertDuplicateSearchStringSetup`)
- [Codeunit 5383 "Create Activity"](../codeunit/5383.md) (1 call: `OnRun → InsertActivity`)
- [Codeunit 5384 "Create Sales Cycle"](../codeunit/5384.md) (1 call: `OnRun → InsertSalesCycle`)
- [Codeunit 5396 "Create Salutations"](../codeunit/5396.md) (1 call: `OnRun → InsertSalutations`)
- [Codeunit 5410 "Create Word Template"](../codeunit/5410.md) (1 call: `OnRun → InsertWordTemplate`)
- [Codeunit 5416 "Create Salesperson/Purchaser"](../codeunit/5416.md) (1 call: `OnRun → InsertSalespersonPurchaser`)
- [Codeunit 5442 "Create Campaign"](../codeunit/5442.md) (1 call: `OnRun → InsertCampaign`)
- [Codeunit 5451 "Create Campaign Status"](../codeunit/5451.md) (1 call: `OnRun → InsertCampaignStatus`)
- [Codeunit 5485 "Create Close Opportunity Code"](../codeunit/5485.md) (1 call: `OnRun → InsertCloseOpportunityCode`)
- [Codeunit 5486 "Create Job Responsibility"](../codeunit/5486.md) (1 call: `OnRun → InsertJobResponsibility`)
- [Codeunit 5534 "Create Interaction Group"](../codeunit/5534.md) (1 call: `OnRun → InsertInteractionGroup`)
- [Codeunit 5553 "Create Activity Step"](../codeunit/5553.md) (1 call: `OnRun → InsertActivityStep`)
- [Codeunit 5572 "Create Industry Group"](../codeunit/5572.md) (1 call: `OnRun → InsertIndustryGroup`)
- [Codeunit 5591 "Create Mailing Group"](../codeunit/5591.md) (1 call: `OnRun → InsertMailingGroup`)
- [Codeunit 5648 "Create Marketing Setup"](../codeunit/5648.md) (1 call: `OnRun → InsertMarketingSetup`)
- [Codeunit 5669 "Create Organizational Level"](../codeunit/5669.md) (1 call: `OnRun → InsertOrganizationalLevel`)
- [Codeunit 5675 "Create Team"](../codeunit/5675.md) (1 call: `OnRun → InsertTeam`)
- [Codeunit 5677 "Create Sales Cycle Stage"](../codeunit/5677.md) (1 call: `OnRun → InsertSalesCycleStage`)
- [Codeunit 5682 "Create Salutation Formula"](../codeunit/5682.md) (1 call: `OnRun → InsertSalutationFormula`)

## Across versions

- Present in: BC29-30
- Changed (declaration) in: none

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: "Contoso CRM")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
