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 :
Small and medium business | Business Central, N...
Answered

How to Auto-populate data On a field

(1) ShareShare
ReportReport
Posted on by 105

Hi all,

I have created a new field called Unit Price in the Transfer Line table and then I added that field in the Transfer Order subform as well. Now when I create a Transfer order and select Item no I want also the Unit price(In my Transfer Line) of that Item to populate directly from the Item card(Take the value which is in the Item card unit price). The same way description and unit of measure populate.

Thank you for your constant assistance.

I have the same question (0)
  • Suggested answer
    JAngle Profile Picture
    133 on at

    Create an event subscriber to the transfer line table OnAfterInsert. Use the .GET() to fill a var of the item table and then pass the required value to your field and modify()

  • Maro9595 Profile Picture
    105 on at

    Thank you Josh,

    Can you please guide me on how to accomplish this you have mentioned new another object "Event subscriber"

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,111 Moderator on at

    Just so you are aware. When you do a transfer the unit cost that is posted will be determined by the costing method on your items. But your added field might fill another purpose. Anyway i just wanted to let you know.

  • Verified answer
    YUN ZHU Profile Picture
    95,548 Super User 2025 Season 2 on at

    Hi, try the following.

    tableextension 80122 MyExtension extends "Transfer Line"
    {
        fields
        {
            modify("Item No.")
            {
                trigger OnAfterValidate()
                var
                    Item: Record Item;
                begin
                    if Item.Get("Item No.") then
                        "Unit Price" := Item."Unit Price";
                end;
            }
            field(50100; "Unit Price"; Decimal)
            {
                DataClassification = CustomerContent;
            }
        }
    }
    
    pageextension 80122 MyExtension extends "Transfer Order Subform"
    {
        layout
        {
            addafter(Quantity)
            {
                field("Unit Price"; Rec."Unit Price")
                {
                    ApplicationArea = All;
                }
            }
        }
    }

    pastedimage1642984435578v1.png

    Hope this will help.

    Thanks.

    ZHU

  • Maro9595 Profile Picture
    105 on at

    that's supper ZHU

    thank you so much

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 > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,151

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,443 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,092 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans