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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Business Central forum

Avoid Extension data Copying on Copy Company

(0) ShareShare
ReportReport
Posted on by 525

Hi

When I create copy of a company, it copies my extension's data to the new company. Can this be controlled/avoided? 

Thanks in advance.

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,172 Most Valuable Professional on at

    The copy of a company copies all data, so also the extension's one. There's no way to avoid this.

  • Mohsin Abbas Profile Picture
    525 on at

    Is there any way to modify this functionality in AL? I just want to clear some tables of my extension.

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,172 Most Valuable Professional on at

    Why not create a codeunit and clear the data you need in the company you need?

  • Mohsin Abbas Profile Picture
    525 on at

    Yeah that's a possible option but can we extend the 'Comapnies' page and call that codeunit on 'Copy Company' action?

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,172 Most Valuable Professional on at

    I don't have now a D365BC sandbox to check if report 357 (Copy Company) has events exposed to subscribe.

    If yes, you can subscribe to the event fired after the copy and then start your custom code for deleting data.

    Otherwise, you can create your custom Copy Company function and disable the standard one. The standard Copy Company report is just a simple report that asks for a new company name and does the following:

    COPYCOMPANY(Name,NewCompanyName);

    After that code, you can start your record deletion.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Business Central

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans