Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Answered

Extension Visibility Issue in Business Central

(2) ShareShare
ReportReport
Posted on by 31
I have three companies in the business central production environment. I have been assigned to add some additional features in Company 1. I have made an extension for Company 1. The changes caused by the extension made for Company 1 must not be seen in either Company 2 or Company 3.

However, when I upload the extension file, the changes made in Company 1 show up in Company 2 and Company 3. 

Can anyone help me make the extension I made visible only in Company One and not in the other two companies? I am a newbie, so please guide me through this if possible.

(For Example, the extension I have created will create two new fields in the sales order page, which is necessary for company 1 but not needed for company 2 and company 3, so I don't want the two fields created using the extension for company 1 to show up in company 2 and company 3)
  • Verified answer
    YUN ZHU Profile Picture
    YUN ZHU 74,141 Super User 2024 Season 2 on at
    Extension Visibility Issue in Business Central
    Just adding some information.
    Dynamics 365 Business Central: Dynamic Visibility of Controls (Hide and show fields dynamically)
     
    Hope this helps.
    Thanks.
    ZHU
  • Suggested answer
    gdrenteria Profile Picture
    gdrenteria 12,475 Most Valuable Professional on at
    Extension Visibility Issue in Business Central
    Hi
    What our colleagues have said about the impact on all companies is correct. Why Extension Installation Applies to All Companies in the Same Database in Microsoft Dynamics 365 Business Central
    You could also use the following link to set some business rules for one company or another.
    Best
    GR
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    Khushbu Rajvi. 5,038 on at
    Extension Visibility Issue in Business Central
    Please try using the code provided below. Remember to change the company name based on the name in your production account.
     
     
    pageextension 50704 "Sales Order Subform Ext" extends "Sales Order"
    {
        layout
        {
            addafter(General)
            {
                group("Lease")
                {
                    ShowCaption = false;
                    Visible = isVisible;
     
                    field("Lease Status"; Rec."Lease Status")
                    {
                        ApplicationArea = All;
                        Caption = 'Lease Status';
                    }
     
                    field("Lease Amount"; Rec."Lease Amount")
                    {
                        ApplicationArea = All;
                        Caption = 'Lease Amount';
                    }
                }
            }
        }
        trigger OnOpenPage()
        begin
            if companyInformation.Get() then
                case companyinformation.Name of
                    'CRONUS IN': //Company 1 name
                        isVisible := true;
                    'My Company'://Company 2 name
                        isVisible := false;
                    'My Company US'://Company 3 name
                        isVisible := false;
                end;
        end;
     
        var
            isVisible: Boolean;
            companyinformation: Record "Company Information";
    }
  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,194 Super User 2024 Season 2 on at
    Extension Visibility Issue in Business Central
    You can add a boolean in ex: company information page and add the condition in all the code changes to execute the code only if that boolean is enabled.
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    Khushbu Rajvi. 5,038 on at
    Extension Visibility Issue in Business Central

    Hello, You cannot set an extension for a specific company . Its per database.

    We can use the DataPerCompany property in a table to specify that the data will only be visible within a specific company. However, this property applies solely to the table itself.

    https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/properties/devenv-datapercompany-propert

     

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 Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,492 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans