---
id: object/codeunit/7030
type: object
title: Codeunit 7030 "Campaign Target Group Mgt"
summary: Codeunit 7030 "Campaign Target Group Mgt" in Base Application (Microsoft.CRM.Campaign). 8 public procedures, 4 events. Present since at least BC23, still in BC30, changed in BC24-25, BC28.
tier: official
language: en
tags:
  - codeunit
  - base application
versions:
  introduced: null
  last_changed: "28"
  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: 70b9c278213f040ac16f7015c0ba286905b931db98370b84ccbf8bb58098316a
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/CRM/Campaign/CampaignTargetGroupMgt.Codeunit.al
    title: src/Layers/W1/BaseApp/CRM/Campaign/CampaignTargetGroupMgt.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: 7030
name: Campaign Target Group Mgt
namespace: Microsoft.CRM.Campaign
app: Base Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "24"
  - "25"
  - "28"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 15
  events: 4
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 2
  called_by: 5
  implements: 0
---

# Codeunit 7030 "Campaign Target Group Mgt"

> Codeunit 7030 "Campaign Target Group Mgt" in Base Application (Microsoft.CRM.Campaign). 8 public procedures, 4 events. Present since at least BC23, still in BC30, changed in BC24-25, BC28.

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

## Events published

- `OnAfterAddSegLineToTargetGroup(var CampaignTargetGr: Record "Campaign Target Group"; var SegLine: Record "Segment Line")` (integration)
- `OnBeforeActivateCampaign(var Campaign: Record Campaign; var IsHandled: Boolean)` (integration)
- `OnBeforeConverttoContact(var Customer: Record Customer; var CampaignTargetGroup: Record "Campaign Target Group"; var CampaignTargetGroup2: Record "Campaign Target Group")` (integration)
- `OnBeforeDeactivateCampaign(var Campaign: Record Campaign; ShowMessage: Boolean; var IsHandled: Boolean)` (integration)

## Procedures

- `ActivateCampaign(var Campaign: Record Campaign)`
- `DeactivateCampaign(var Campaign: Record Campaign; ShowMessage: Boolean)`
- `AddSegLinetoTargetGr(SegLine: Record "Segment Line")`
- `DeleteSegfromTargetGr(SegLine: Record "Segment Line")`
- `AddInteractionLogEntry(InteractionLogEntry: Record "Interaction Log Entry")`
- `DeleteContfromTargetGr(InteractLogEntry: Record "Interaction Log Entry")`
- `ConverttoCustomer(Contact: Record Contact; Customer: Record Customer)`
- `ConverttoContact(Cust: Record Customer; CompanyContNo: Code[20])`

Plus 3 local procedures.

## Triggers

OnRun

## 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 27 "Confirm Management"](../codeunit/27.md) (1 call: `ActivateCampaign → GetResponseOrDefault`)
- [Codeunit 7001 "Price Calculation Mgt."](../codeunit/7001.md) (1 call: `NoPriceDiscForCampaign → IsExtendedPriceCalculationEnabled`)

## Called by

- [Table 5050 "Contact"](../table/5050.md) (3 calls: `CreateCustomerFromTemplate → ConverttoCustomer`, `OnDelete → DeleteContfromTargetGr`, `TypeChange → DeleteContfromTargetGr`)
- [Table 5077 "Segment Line"](../table/5077.md) (3 calls: `OnDelete → DeleteSegfromTargetGr`, `SetCampaignTargetGroup → AddSegLinetoTargetGr`, `SetCampaignTargetGroup → DeleteSegfromTargetGr`)
- [Table 18 "Customer"](../table/18.md) (1 call: `DeleteRelatedData → ConverttoContact`)
- [Table 5065 "Interaction Log Entry"](../table/5065.md) (1 call: `OnDelete → DeleteContfromTargetGr`)
- [Table 5071 "Campaign"](../table/5071.md) (1 call: `OnDelete → DeactivateCampaign`)

## Across versions

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

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: "Campaign Target Group Mgt")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
