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
    82,915 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
    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
    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
    60,228 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
    22,999 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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
YUN ZHU Profile Picture

YUN ZHU 616 Super User 2025 Season 1

#2
Mansi Soni Profile Picture

Mansi Soni 463

#3
Sagar Dangar, MCP Profile Picture

Sagar Dangar, MCP 391

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans