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

Notifications

Announcements

No record found.

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.

I have the same question (0)
  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    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();
    }

  • Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

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

  • Ganesh Potnuru Profile Picture
    170 on at

    Hi Martin

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

  • Ganesh Potnuru Profile Picture
    170 on at

    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.

  • Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    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

    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..

  • Verified answer
    Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    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.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 551 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 278 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans