Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Answered

Is it possible to change the field caption with the value of another table field.

Posted on by 186

if it is possible to do then please help me to archive this. Here I tried by assigning the same field value. But I am unable to get the value of a field that is from another table.

pastedimage1651682406411v2.png

  • Verified answer
    Umang Srivastava Profile Picture
    Umang Srivastava 100 on at
    RE: Is it possible to change the field caption with the value of another table field.

    you can check the below code in page sales order subform where shortcut dimensions are shown on the basis of different dimensions values selected in GL setup.

    field(ShortcutDimCode3; ShortcutDimCode[3])

                   {

                       ApplicationArea = Dimensions;

                       CaptionClass = '1,2,3';

                       TableRelation = "Dimension Value".Code WHERE("Global Dimension No." = CONST(3),

                                                                     "Dimension Value Type" = CONST(Standard),

                                                                     Blocked = CONST(false));

                       Visible = DimVisible3;

                       trigger OnValidate()

                       begin

                           ValidateShortcutDimension(3);

                       end;

                   }

    to setup like the above one now you need to define the caption likewise in codeunit 343 "Dimension CaptionClass Mgmt" you can have a look on this codeunit it will give you better idea to achive custom caption.

  • Verified answer
    YUN ZHU Profile Picture
    YUN ZHU 73,565 Super User 2024 Season 2 on at
    RE: Is it possible to change the field caption with the value of another table field.

    Hi, hope the following will help.

    https://yzhums.com/13188/

    Thanks.

    ZHU

  • Verified answer
    Techworld Profile Picture
    Techworld 106 on at
    RE: Is it possible to change the field caption with the value of another table field.

    Hi,

    If you mean that you have another dimension which you are using in Business Central apart from Global Dimension 1 and 2 and you want to display the name Caption Dimension Code of dimension selected on Customer Card then you can use Caption Class by changing Last Value in Caption class 1,2,3 or 1,2,4 it will appear for the Dimension selected on General Ledger Setup.

    and adding two fields in Table Extension

     field(90000; "SD 3 Code"; Code[20])
            {
                Caption = 'SD 3 Code';
                CaptionClass = '1,2,3';
                TableRelation = "Dimension Value".Code WHERE("Global Dimension No." = CONST(3),
                                                              Blocked = CONST(false));

                trigger OnValidate()
                begin
                    ValidateShortcutDimCode(3, "SD 3 Code");
                end;
            }
            field(90001; "SD 4 Code"; Code[20])
            {
                Caption = 'SD 4 Code';
                CaptionClass = '1,2,4';
                TableRelation = "Dimension Value".Code WHERE("Global Dimension No." = CONST(4),
                                                              Blocked = CONST(false));

                trigger OnValidate()
                begin
                    ValidateShortcutDimCode(4, "SD 4 Code");
                end;
            }

    Is your organization anyhow is using more than 8 Dimension and you want to reflect 9th Dimension value is it the Case,?

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: Is it possible to change the field caption with the value of another table field.

    Hi DyavariS ,

    You please refer any matrix page in the system, for ex. Item by location, see the image below, please check this page in design mode, it will help you to understand how to change field caption dynamicaly.

    pastedimage1651729584176v1.png

    Thanks.

  • RE: Is it possible to change the field caption with the value of another table field.

    Thanks for the reply @tanya kharbanda. Here I am doing the task on dimensions. There I Have to display the related values based upon the caption.

  • Verified answer
    tanya07 Profile Picture
    tanya07 1,554 on at
    RE: Is it possible to change the field caption with the value of another table field.

    Hi,

    Why would you want to change the field caption with the value of another table field?

    Can you please elaborate more?

    You can definitely assign the value of one field to another.

    Thanks,

    Tanya Kharbanda

    Don't forget to help the community by verifying the answer if your question has been answered. It will let others know that the topic has a verified  answer.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans