Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

If Salesperson is changed on Customer table, how to changed it on Posted documents

Posted on by 6

We need to change Salesperson codes on Customer card to another salesperson code.  If it changed on customer table, I understand we have posted documents related to previous Salesperson codes. Also, I understand posted documents cannot be changed

However, I would need advice how to change in the Sales Invoice Header, Value Entry & Cust. Ledger Entry Table. [ for reporting purpose]  Can I directly modify the value of "Salesperson Code" in Sales Invoice Header, Value Entry & Cust. Ledger Entry Table. Using configuration package,

  1. Create configuration package
  2. Add related table s [Sales Invoice Header, Value Entry & Cust. Ledger Entry Table]
  3. Export by excel
  4. Make adjustment to data in excel and save the file
  5. Go back to configuration package and import by excel
  6. Apply the data

 

Appreciate your valuable advice please? am using BC 19 at this point.

Many Thanks, Indu

Categories:
  • Hein Kruger Profile Picture
    Hein Kruger 501 on at
    RE: If Salesperson is changed on Customer table, how to changed it on Posted documents

    If it's only for reporting purposes and you have a business rule in place to always use the Sales person code assigned to the Customer. You can modify the report.  In the OnAfterGet procedure of the Header dataitem. Get the Custom record and assign the SalesPerson Code as a column in the header.  It will look something like this.:

    dataitem(Header; "Sales Invoice Header")

    {

    //Replace this column with the following if its a new report otherwise in the report extension you can add the code.

    //column(SalespersonCode_Header; "Salesperson Code")

    //           {

    //           }

    column(SalespersonCode_Header; CustomerSalesPersonCode)

            {

           }

    trigger OnAfterGetRecord()

               var

                   Customer: Record Customer;

               begin

                   Customer.Reset();

                   Customer.SetRange("No.",Header."Sell-to Customer No.");

                   if Customer.FindFirst() then

                   CustomerSalesPersonCode :=  Customer."Sales Person Code";

              end

    }

    var

    CustomerSalesPersonCode : Code[30];

    It is not ideal but it should work. I would advise a boolean on the request page to ask the user for which Sales Person Code the report should show but then the code will change a bit.

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 32,748 Super User 2024 Season 1 on at
    RE: If Salesperson is changed on Customer table, how to changed it on Posted documents

    If you simply rename the sales person. All related data will be updated.

    So if you have  a sales person IJ that you want to change to f.ex. 100 you can simply do that in the sales person page and all related entries will be updated.

    I would not recommend updating already posted transactions. If you really need to do that you should contact your partner and have them assist you in the process to make sure your data stays consitant.

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: If Salesperson is changed on Customer table, how to changed it on Posted documents

    Hi,

    Your question is more into change Posted data, so you can not do that in anyways, in that case if there is no option to change the posted data you need to consult with your development partner to assist in this case.

    Thanks.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans