Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

What is "select friend packages"

(0) ShareShare
ReportReport
Posted on by 308

Hi,

When updating model parameters, there is a new tab called Select Friend packages.

What is that?

Based on what does model appear in it?

What happens if i tick one of the packages appearing in the friend packages?

  • GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: What is "select friend packages"

    You are again confusing. It's about calling the internal method on another class. Not about hiding the internal class or method.

    This functionality doesn't have proper Microsoft documentation available. Even we also not familiar with this. You need to do more research on this and got better idea on this. Whatever we know we have shared with you.

    Thanks,

    Girish S.

  • DELDYN Profile Picture
    DELDYN 308 on at
    RE: What is "select friend packages"

    Hi Martin,

    That's what I'm saying..model X doesn't reference model A...so why did model A appear as a friend package for model x?

    I mean the reason for friends packages is to call internal methods or variables..but if model X can't access model A in the first place due to circular reference , why did it appear as a friend package

    regarding 2...i didn't say i want to call the internal method...i said if a public class has an internal method . If i click on the class to view it's code, will the method be hidden?

  • GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: What is "select friend packages"

    One thing you need to understand model referencing is different and friend package is different.

    You are going to access the internal methods from the reference models (Parent model) that's what the functionality of friend package.

    There won't be any circular dependency.

    Thanks,

    Girish S.

  • Martin Dráb Profile Picture
    Martin Dráb 230,868 Most Valuable Professional on at
    RE: What is "select friend packages"

    There won't be any circular reference because making a package a friend doesn't add a reference.

    The problem is that your design is completely wrong. Model X can't call the method in Model A if Model X doesn't have a reference to Model A. This can't work, but it has nothing to do with friend packages.

    Re 2: You'll get an error if you tried to call the internal method, because you aren't allowed to do it. The developer allowed the class to be used by everyone (by making it public) but restricted access to this method (by making in internal). Feel free to create a new thread if you don't understand access modifiers at all. We can then return to this thread about friend packages when you understand the purpose of access modifiers.

  • DELDYN Profile Picture
    DELDYN 308 on at
    RE: What is "select friend packages"

    Hi Girish,

    What u said took me back to the first question

    If Model A has internal "test" method and model A references Model X

    If i add for model X a friend package with model A.

    How am i going to access method test? There is circular reference

    Hi Martin,

    2. But the class is public while one of the methods is internal. Why would i get a compilation error?

    Shouldn't the method be hidden and that's it?

  • Martin Dráb Profile Picture
    Martin Dráb 230,868 Most Valuable Professional on at
    RE: What is "select friend packages"

    1. No, it doesn't show all custom models. I think it shows models with a reference to the model you're configuring. You can easily test it by yourself.

    2. You'll get a compilation error if you tried to access internal members from another package.

    3. The call of the public method will work. What happens inside the method is irrelevant.

  • GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: What is "select friend packages"

    It won't show all custom models. Only the reference models as I said earlier.

    It is not about seeing the internal method in the models.

    Suppose you created internal method say "test" in Model A. There is one more model Model B where you select friend package as Model A. Mostly the method that are declared as internal cannot be used outside of the model. It will be used only inside the model.

    Since you selected Model A as Friend package in Model B you can use or call that internal method "test" created in Model A.

    Thanks,

    Girish S.

  • DELDYN Profile Picture
    DELDYN 308 on at
    RE: What is "select friend packages"

    So as a conclusion

    Friends Packages show all custom models in the system

    Friends packages only allow us to view internal variables and internal methods -- without being able to call them by code

    1. Correct?

    2. So if we don't add a friend package, when we open a class thay has internal methods, they will be hidden?

    3. And if don't add a friend package, what if there is a public method and inside it an internal method is called...will i see it?

  • Martin Dráb Profile Picture
    Martin Dráb 230,868 Most Valuable Professional on at
    RE: What is "select friend packages"

    Saying that a package is allowed to access internal members isn't the same thing as adding a reference.

    For example, if you say model A allows model B to see its internals, it doesn't mean that A can use objects defined in B.

  • GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: What is "select friend packages"

    For the example you said. Model X is child package of Model B and also Model C.

    So, it appears in friend package selection.

    Also referencing the model and selecting a friend package is two different things.

    Thanks,

    Girish S.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,031 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,868 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans