Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

PurchTable - populate createdBy field value at line level

(0) ShareShare
ReportReport
Posted on by 674

Hi all,

I would like to populate createdBy field value on a form at a line level and make it searchable. 

I see that PurchTable table has createdBy field but PurchLine table does not have that value although there is a relation btw two tables.

In order to populate createdBy field on a form at a line level, what would be the best approach?

I have been thinking like 

1. create a purchLine table extension and add a new field purchLine.Createdby

2. add a method to populate the createdBy field from PurchTable using select keyword 

3. add this new field to the form to show at a purchase line level. 

would this be OK ? or are there a better way to do it?

Thank you. 

  • Suggested answer
    nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: PurchTable - populate createdBy field value at line level

    Hi ShawnDEV,

    I don't think it makes sense to duplicate the value from PurchTable to all PurchLines. This value already exists in PurchTable so you can always read/show it from there.

  • ShawnDEV Profile Picture
    674 on at
    RE: PurchTable - populate createdBy field value at line level

    Hi,

    If I need a runnable class for the existing records in any cases, wouldn't it better to enable 'created by' property in purchLine table for new records and then run the runnable class for that standard field instead of creating a new field  (purchLine.myCreatedBy) and run the same runnable class?

    Thank you.

  • André Arnaud de Calavon Profile Picture
    295,379 Super User 2025 Season 1 on at
    RE: PurchTable - populate createdBy field value at line level

    You can use a CoC method and extend the logic for the method 'initFromPurchTable()' on the PurchLine table.

    You also might need a runnable class for an initial loop on already existing purchase order lines and update your field then.

  • ShawnDEV Profile Picture
    674 on at
    RE: PurchTable - populate createdBy field value at line level

    Hi

    Ok, then how can I show createdby field value of the existing purchLine from purchTable table?

    I created a new field in the purchLine table via the extension. But I am struggling with filling the value of it from the PurchTable table. I can somehow fill the value using select keyword. But where should I add this method which fills the value of purchLine.my_createdBy field? as this field value should be seen in the PurchLineOpenOrder form and searchable, should I use formeventhandler?

    Thank you.

  • André Arnaud de Calavon Profile Picture
    295,379 Super User 2025 Season 1 on at
    RE: PurchTable - populate createdBy field value at line level

    Hi ShawnDEV,

    When you enable this option, it will only work for new records. All already existing records will indeed not have the CreatedBy filled.

  • ShawnDEV Profile Picture
    674 on at
    RE: PurchTable - populate createdBy field value at line level

    Hi,

    I once changed the value of property Createdby to Yes, but the field value is "?" on all lines.. It does not show the value from the Purchase order header. That's why I am trying to find another way to show it.

    Or is there a way to avoid showing "?" values and show the actual value from purchTable table?

    Thank you.

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    295,379 Super User 2025 Season 1 on at
    RE: PurchTable - populate createdBy field value at line level

    Hi ShawnDEV,

    You can create a table extension and change the value of the property CreatedBy to enable the field on the purchase order lines. The field will be then automatically polulated. If you want to search on this field, you have to consider creating an index with this field to prevent performance issues and database locks.

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

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

#1
Martin Dráb Profile Picture

Martin Dráb 601 Most Valuable Professional

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 416

#3
Adis Profile Picture

Adis 384 Super User 2025 Season 1

Product updates

Dynamics 365 release plans