John
John

Reputation: 773

Dynamically change TEXT of Tab Item

How we can change the text of the TAB Item dynamically based on Order Type in Sales order screen.

for example: for TR order type, I want to change Document Details to Transfer Details.

Upvotes: 0

Views: 262

Answers (1)

Hugues Beauséjour
Hugues Beauséjour

Reputation: 8278

To my knowledge there is no DAC binding for changing Tab Header Text from the business logic layer (graph). A possible workaround if you have a limited number of alternative Tab Header Text could be to create a tab for each of them and dynamically hide them based on your display condition.

How to hide Tabs in Acumatica: Hiding a tab from the user interface dynamically

The other option would be to use JavaScript to change the inner element of the Tab Header Control.

Both options are less than ideal and can have an impact if you're looking to have your customization certified by Acumatica but if it's a hard requirement that's the only ways to do it that I'm aware of.

In the following example I'm using the hardcoded HTML Control ID for the Tab Header Control that I looked up using the Inspect Element feature provided by HTML browsers:

<asp:Content ID="cont1" ContentPlaceHolderID="phDS" Runat="Server">
    <script type="text/javascript">
        $(function() {
            $(document)
                .ready(function() {
                    document.getElementById("ctl00_phG_tab_tab0").innerHTML = "My Tab Header Text";
                });
        });
    </script>

    [...]
</asp:Content>

enter image description here

Upvotes: 0

Related Questions