Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How to get Legal entity value in my custom field for every record created in table

(0) ShareShare
ReportReport
Posted on by 170

Hi there,

I have a field called legal entity in my table, in this field I want my legal entity name for every record created.

ThankYou.

  • Verified answer
    Martin Dráb Profile Picture
    232,982 Most Valuable Professional on at
    RE: How to get Legal entity value in my custom field for every record created in table

    Don't let end-users be technical architects; they're usually not trained in things like the design of relation databases. It's our role to do this work.

    Let users define business requirements and then design a technical solution that meets both business requirements and non-functional requirements (e.g. regarding maintainablity, performance, data consistency and so on).

    It seem that they believe that a field must be added to the particular table to be addable via personalization, which isn't true. It's also not true that all fields of a table can automatically be added that way. Therefore their technical design seems to be based on wrong assumptions.

    Also, could you please respond to my previous reply? What the point ot adding DataAreaId by custom code instead of using rhe standard field? It seems like spending money to make the system slower and achieving nothing. But maybe there is a reason - that's why I asked.

  • Ganesh Potnuru Profile Picture
    170 on at
    RE: How to get Legal entity value in my custom field for every record created in table

    Hi goshoom

    They want to show legal entity in form but, not in the grid, they want it in the table as a field if they want to show it in the form they can add it from listed fields while clicking on insert columns in the form..

  • Martin Dráb Profile Picture
    232,982 Most Valuable Professional on at
    RE: How to get Legal entity value in my custom field for every record created in table

    What is the point of this code? If the table isn't shared, the value is already stored by the system in DataAreaId, therefore you don't need to waste storage for another field, you don't need any code and you don't have to prevent set-based operations by overriding insert().

    If the table is shared, isn't it a design flaw?

  • Ganesh Potnuru Profile Picture
    170 on at
    RE: How to get Legal entity value in my custom field for every record created in table

    Hi Gunjan Bhattachayya 

    This is working but it's reflecting name but I want legal entity like ex: USMF 

    I got it by using this

    this.LegalEntity = CompanyInfo::find().DataArea;
    super();

    Thank you.

  • Ganesh Potnuru Profile Picture
    170 on at
    RE: How to get Legal entity value in my custom field for every record created in table

    Hi Martin

    could you please tell me how to do it and where? at table level?

  • Martin Dráb Profile Picture
    232,982 Most Valuable Professional on at
    RE: How to get Legal entity value in my custom field for every record created in table

    Don't duplicate the information. Join your table with CompanyInfo to get the name.

  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,421 on at
    RE: How to get Legal entity value in my custom field for every record created in table

    Hi Ganesh,,

    You can set the legal entity name in the insert method of your table.

    public void insert()
    {
        this.LegalEntityName = CompanyInfo::find().Name;
        
        super();
    }

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,233 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,982 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans