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

Add the value of a new custom field to another related table

(1) ShareShare
ReportReport
Posted on by 36
Hi,
I have added a custom field called Item Description to the item table as the current Description field is too short

I want the value of this field to show  (that was entered in the item card page) in the Blanket Purchase Order when I select an item


I can get it to show as a Flow field but I don't want this as it needs to be editable.  I just want to show this new field in the same way as the currrent Description shows.

Any help appreciated. Tried some trigger OnAfterGetRecord() code in the page extension of the Blanket Purchase Order but didn't work
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 78,009 Super User 2025 Season 1 on at
    Add the value of a new custom field to another related table
    Personally, I do not recommend this customization because there are too many tables related to Item Description.
    Even if you add new fields and add this function to Blanket Purchase Order, only these two places are available, and the standard Item Description will still be displayed in other features. 
    In addition, this is also related to the posting code. If you assign a value of length 500 to a field of standard length 100, an error will be prompted or the first 100 characters will be automatically taken.
     
    As for the problem you mentioned, you can refer to the following way.
     
    Thanks
    ZHU
     
  • Yasas Profile Picture
    Yasas 55 on at
    Add the value of a new custom field to another related table
    In Business Central, there is a feature for extended descriptions in the Item card. I suggest you try that function to see if it fulfills your requirements.


    Best Regards,
    Yasas.
  • MartinaHawkins Profile Picture
    MartinaHawkins 36 on at
    Add the value of a new custom field to another related table
    Got it to work. Is there anything I am missing?  Description 2 is only 50 characters
     
    addafter("Item No.")
            {
                field("Item Description KGS"; Rec."Item Description KGS")
                {
                    ToolTip = 'Item Description';
                    ApplicationArea = all;
                }
            }
    trigger OnAfterGetRecord()
        begin
            SetMyStyle();
            
            Desc.reset;
            Desc.SetRange("No.", Rec."Item No.");
            If Desc.FindFirst() then begin
                rec."Item Description KGS" := Desc."Item Description KGS";
            end;

        end;

        procedure SetMyStyle()
        begin
            if (rec."Item Status KGS" = 'Risky') then
                Mystyle := 'Unfavorable' else
                Mystyle := 'Standard';
        end;

        var
            MyStyle: Text;
            Desc: Record "Item";
  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 60,161 Super User 2025 Season 1 on at
    Add the value of a new custom field to another related table
    I would suggest you to use standard Description 2 field if you are not already using so you dont have to do any development.
     
     
    Back to your question :)
     
    The Item field values are copied to purchase line in a CopyFromItem function of Table 39
    You can subscribe to OnAfterAssignItemValues event/publisher and update your field.
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    Mohamed Amine Mahmoudi 15,801 Super User 2025 Season 1 on at
    Add the value of a new custom field to another related table
    Hi,
     
    I think you use OnValidate trigger to populate your new custom field.
     
    for old records you need to create a few code to update the new field.
     
    Best regards,
    Mohamed Amine MAHMOUDI

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February 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... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans