web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Campaign error > Activate Sales Prices/Line Discounts can not be activated

(0) ShareShare
ReportReport
Posted on by 15

When I try to activate Sales Prices on a Campaign, I run into an error:

1401.error1.jpg

This seems like a correct error statement, because on the Segment Card the Campaign Target has not been enabled yet.

However, when I enable Campaign Target (either the check marks on the lines or the button on the tab Campaign), I get another error:

2210.error2.jpg

So, these errors gat me stuck in a loop; If I do not checkmark/enable BC asks me to enable, and when I do checkmark/enable it tells Campaign Target Group already exists...

Any ideas or insights about this are welcome!

To test this I used a standard CRONUS database (version 16.3.14085.14287)

I have the same question (0)
  • Suggested answer
    Bryan Tschosik Profile Picture
    on at

    Hello,
    Thank you for using BC Communities.

    In regards to the first error, it is true that in order to activate Sales Prices/Line Discounts you must have this campaign assigned to a Segment with the 'Campaign Target' = TRUE.

    As you are attempting to fix this, I'm not sure I'm clear on where you are doing this at. The 2nd screenshot shows you are still on the Campaign....so I am not sure if that is where you are trying to fix this.

    If you are not doing this already (and I apologize if you are, but I just want to verify) go to a Segment you have created in which you want to assign this campaign to. On the Segment Card, go to the Campaign fast tab... be sure you have this Campaign assigned to it and then set the 'Campaign Target' = TRUE

    pastedimage1597424481801v1.png

    https://docs.microsoft.com/en-us/dynamics365/business-central/marketing-campaigns

    Please let me know if that is what you are already doing and that is where you are receiving the error message.  I just want to verify becuase your second screnshot loooks like you are getting an error while your on the Campaign Card.  Thank you
    Bryan

  • Eelco@Prodware Profile Picture
    15 on at

    Hello Bryan,

    Thanks for your quick reply.

    What you describe is exactly the case. Because the campaign has to be assigned to a segment, I opened the segment and and set campaign target to TRUE. Is does not matter if if do this using the button on the campaign fast tab, or by using the checkmarks on the segment lines; the result is the same.

    After setting the campaign target to TRUE, I go back to the campaign card (that is why you see the 2nd error there) and click in the ribbon on "Process" > "Activate Sales prices/line discount" > Yes > error...

    Instead of activating sales prices, it is also possible to go 1 level up, to "Campaigns", and select the campaign line and activate it there; same result.

    I also asked a colleague, and he thought it looks like a bug.

    I am looking forward to hear from you!

  • Suggested answer
    Kieran Sweeney Profile Picture
    30 on at

    This looks like a bug to me as well. I was able to replicate this error in Version: Platform 14.0.43793.0 Application 43800 (US Business Central 14.15).

    The Campaign Target Group is a table consisting of three fields:

    • Type (Option: Customer/Contact)
    • No. (Code)
    • Campaign No (Code)

    As contacts are added/removed, it looks like BC fails to check and prevent duplicates from populating this table.

    As a stop-gap, you could deploy a simple extension that exposes the Campaign Target Group as a list page. From there, get a super user to delete the offending duplicate records.

    I can think of two ways MS could resolve this bug:

    1. Segment Contact Insertion: don't duplicate input of Campaign Target Group as contacts are added/removed. Put a unique requirement on the table to raise the error before price activation.
    2. Activate Sales Price/Line Discounts Validation: Filter to distinct Campaign Target Groups as a pre-step.

    On another note, is there a good reason why campaign segments must be created to deploy campaign prices?

    In my use case, I don't care to restrict or track any CRM prospects of this campaign. I just want to use the Campaign mechanism to add a same-code dimension to my sales lines for tracking. This will help separate which esulted from a campaign from discretionary discounts issued by the Salesperson.


    Edit:

    It turns out that the primary key to the Campaign Target Group is a composite of Type, No., and Code. This is what's causing the error when activating Sales Prices and Line Discounts.

    The ActivateCampaign procedure gets called from the Campaign Target Group Management Codeunit, which in turn calls the AddSegLinetoTargetGr local procedure for each Segment Line. Contact Business Relationships are checked against the Contact, and InsertTargetGroup is called either against the Contact or Customer.

    The issue is that InsertTargetGroup does not check to see if there is already an existing target group before inserting; so, the unique requirement of the Campaign Target Group triggers an error:

    local procedure InsertTargetGroup(Type: Option; No: Code[20]; CampaignNo: Code[20])
    begin
    	CampaignTargetGr.Type := Type;
    	CampaignTargetGr."No." := No;
    	CampaignTargetGr."Campaign No." := CampaignNo;
    	CampaignTargetGr.Insert(true);
    end;

    This local procedure should be modified to first check for a match and to insert if there is none:

    local procedure InsertTargetGroup(Type: Option; No: Code[20]; CampaignNo: Code[20])
    begin
    	CampaignTargetGr.Reset();
    	if CampaignTargetGr.Get("Type", No, CampaignNo) then
    		exit;
    	CampaignTargetGr.Init();
    	CampaignTargetGr.Type := Type;
    	CampaignTargetGr."No." := No;
    	CampaignTargetGr."Campaign No." := CampaignNo;
    	CampaignTargetGr.Insert(true);
    end;

  • Eelco@Prodware Profile Picture
    15 on at

    Hello Bryan,

    I agree with the comment the comment of Kieran below, @Kieran: thank you for replying!

    However, the mechanics behind Campaigns and Segments seem to be a bit more strange.

    As I was trying some different things, I found out that if I make a Segment where I choose "Banks" as filter for the Contacts to add, I can activate the Campaign without a problem....

    After checking the Business Relations, I found out that these Contacts where only part of 1 segment.

    At first I thought that Contacts can only be part of 1 Segment, which would make this functionality very limited, but it turns out that that fortunately is not the problem.

    The problem is multiple Contacts from the same Company...

    To add Contacts, I used only one filter, which was Business Relation Code, set on CUST.

    Most Customers in CRONUS (and in reality) have more than 1 contact per Company.

    If I only use Adatum Corporation from the CRONUS Database, I get 2 Contacts in my Segment lines:

    - Adatum Corporation (company contact)

    - Robert Townes (person contact from Adatum Corporation)

    ==> Activating this gives the error.

    However, if I delete 1 of the 2 contacts from Adatum Corportation, activating the Campaign is no problem at all!

    While this solves the problem of not being able to activate a Campaign, I think this is still not correct.

    Because this implies I can only address 1 contact per company for a Campaign.

    I know many customers where for example the Sales department has multiple Salesmen. If I launch a Campaign I want to be able to target all of them, instead of a single one, so I get as much response as possible.

    I am looking forward to hear what you think of this!

  • Community Member Profile Picture
    on at

    Hi,

    I met same issue on last versions.

    We will try the solution given by Kieran.

    I am agree with Eelco, how would you solve this issue?

    Which kind of alternative solution could you purpose, to manage campaign in BC?

    Will you add this patch in the next update?

    Thanks in advance,

  • Bryan Tschosik Profile Picture
    on at

    Thank you, My apologies for lack of response on this forum, I try my best to answer these when I can, but day to day activities doesn't always allow me to get back to it...

    We will need you to report this to MSFT as a Support Ticket.  Please Open a new SR, and provide detailed reproduction steps so we can report this to Development.

    Thank you.

    Bryan

  • Community Member Profile Picture
    on at

    Hi and thank you Bryan for your quick answer.

    I will write a document and submit a request.

    Thanks

  • Community Member Profile Picture
    on at

    Hi,

    Solution expected on release 18.4.

    Regards

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,238

#2
YUN ZHU Profile Picture

YUN ZHU 773 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 630

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans