web
You’re offline. This is a read only version of the page.
close
Skip to main content
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
I have the same question (0)
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    26,348 Super User 2025 Season 2 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
  • Suggested answer
    Mohana Yadav Profile Picture
    60,977 Super User 2025 Season 2 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.
  • 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";
  • 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.
  • Suggested answer
    YUN ZHU Profile Picture
    93,438 Super User 2025 Season 2 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
     

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
Sumit Singh Profile Picture

Sumit Singh 2,204

#2
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 1,933

#3
YUN ZHU Profile Picture

YUN ZHU 1,885 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans