web
You’re offline. This is a read only version of the page.
close
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

Rename Group on a native page

(1) ShareShare
ReportReport
Posted on by
Hi all,
How do I rename Request Approval on Purchase Invoice Card?
I have the same question (0)
  • Suggested answer
    Mohana Yadav Profile Picture
    61,005 Super User 2025 Season 2 on at
    You can create a pageextension like below
     
    pageextension 50000 PurchaseInvoiceExt extends "Purchase Invoice"
    {
        layout
        {
        }
        actions
        {
            modify(Category_Category8)
            {
                Caption = 'New caption for Request Approval group';
            }
        }
    }
     
    Result:
     
  • Suggested answer
    Shivi1307 Profile Picture
    13 on at
    Caption is the way to rename anything on the page.
  • RomRyan Profile Picture
    on at
    Mohana,
     
    If I use
           modify(Category_Category8)
            {
                Caption = 'New caption for Request Approval group';
            }
     
    I get an error
     
    The Group 'Category_Category8' cannot be referenced in PageExtension 'PurchaseInvoice' because 'Category_Category8' is defined in the promoted part of the action part while 'PurchaseInvoice' uses promoted action properties.ALAL0737
    Group Category_Category8
     
    If I use
    modify("Request Approval")
            {       
            
                Caption = 'Approval';           
                      
            }
    The caption is not changing to Approval.
  • Suggested answer
    Mohana Yadav Profile Picture
    61,005 Super User 2025 Season 2 on at
    Do you have any other actions on the pageextension which are using Promoted or PromotedCategory etc.?
    Please change them to reference the Promoted parts in the base Purchase Invoice page.
  • RomRyan Profile Picture
    on at
    Mohana,
     
    There are other actions in the group and have 
     
    Promoted = true;
                    PromotedCategory = Category8;
                    PromotedIsBig = true;
     
    i.e. Send Approval Request and Cancel Approval Request
    But they need to under Request Approval (group) which I want to rename it to Approvals but still maintain Send Approval Request and Cancel Approval Request under Request Approval without changing any position.
     
    How can I achieve this?
     
     
     
     
  • Mohana Yadav Profile Picture
    61,005 Super User 2025 Season 2 on at
    Can you share the whole code of the purchase invoice pageextension?
  • RomRyan Profile Picture
    on at
    Mohana,
    pageextension 51000 PurchaseInvoice extends "Purchase Invoice"
    {
        layout
        {
            modify("Posting Date")
            {
                Editable = IsEditable;
            }
            modify("Document Date")
            {
                Editable = IsEditable;
            }
            modify("Due Date")
            {
                Editable = IsEditable;
            }
            addafter(Status)
            {
                field("Last Modified At"; Rec.SystemModifiedAt)
                {
                    ApplicationArea = All;
                    Caption = 'Last Modified At';
                    Editable = false;
                }
                field("Last Modified By"; GeneralMgt.GetUserName(Rec.SystemModifiedBy))
                {
                    ApplicationArea = All;
                    Caption = 'Last Modified By';
                    Editable = false;
                }
            }       
            
        }
        actions
        {
            modify(SeeFlows)
            {
                Visible=false;
            }
             /*modify(Category_Category8)
            {
                Caption = 'New caption for Request Approval group';
            }*/
            
            modify("Request Approval")
            {       
            
                Caption = 'Approval';           
                      
            }  
            modify(SendApprovalRequest)
            {
                Visible = false;
            }
            addafter(SendApprovalRequest)
            {
                action("Send Approval Request")
                {
                    ApplicationArea = Basic, Suite;
                    Caption = 'Send A&pproval Request';
                    Enabled = NOT OpenApprovalEntriesExist AND CanRequestApprovalForFlow;
                    Image = SendApprovalRequest;
                    Promoted = true;
                    PromotedCategory = Category8;
                    PromotedIsBig = true;
                    ToolTip = 'Request approval of the document.';
                    trigger OnAction()
                    var
                        ApprovalsMgmt: Codeunit "Approvals Mgmt.";
                        //PurchH: Record "Purchase Header";
                        PurchLine: Record "Purchase Line";
                        PostedInv: Record "Purch. Inv. Header";
                    begin
                        If ApprovalsMgmt.CheckPurchaseApprovalPossible(Rec) then Begin
                            Rec.Reset();
                            Rec.SetRange("No.", Rec."No.");
                            Rec.SetRange("Document Type", Rec."Document Type"::Invoice);
                            If Rec.FindFirst() then begin
                                
                                PurchLine.Reset();
                                PurchLine.SetRange("Document Type", PurchLine."Document Type"::Invoice);
                                PurchLine.SetRange("Document No.", Rec."No.");
                                PurchLine.Setfilter("Amount Including VAT", '=%1', 0);
                                If PurchLine.FindFirst() then Begin
                                    Message('The invoice has zero amount');
                                End
                                Else Begin
                                    ApprovalsMgmt.OnSendPurchaseDocForApproval(Rec);
                                End;
                            End;
                            //
                            PostedInv.Reset();
                            PostedInv.SetRange(PostedInv."Buy-from Vendor No.",Rec."Buy-from Vendor No.");
                            PostedInv.SetRange(PostedInv."Vendor Invoice No.",Rec."Vendor Invoice No.");
                            If PostedInv.FindFirst() then begin
                                Error('Invoice %1 for Vendor %2 already exist and is among the posted invoices. This requires a change in vendor''s invoice number.',Rec."Vendor Invoice No.",Rec."Buy-from Vendor Name");
                            end;
                            //
                        End;
                    End;
                }
                
            }
            modify(Approvals)
            {
                Visible = false;
            }
            addafter(CancelApprovalRequest)
            {
                action("View Approvals")
                    {
                        AccessByPermission = TableData "Approval Entry" = R;
                        ApplicationArea = Suite;
                        Caption = 'View Approvals';
                        Image = Approvals;
                        Promoted = true;
                        PromotedCategory = Category8;
                        ToolTip = 'View a list of the records that are waiting to be approved. For example, you can see who requested the record to be approved, when it was sent, and when it is due to be approved.';
                        trigger OnAction()
                        var
                            ApprovalsMgmt: Codeunit "Approvals Mgmt.";
                        begin
                            ApprovalsMgmt.OpenApprovalsPurchase(Rec);
                        end;
                    }
            }

        }
        Trigger OnNewRecord(BelowxRec: Boolean)
        begin
            FieldNotEditable();
        end;
        //
        trigger OnAfterGetCurrRecord()
        begin
            SetControlAppearance;
            CurrPage.IncomingDocAttachFactBox.PAGE.LoadDataFromRecord(Rec);
            CurrPage.ApprovalFactBox.PAGE.UpdateApprovalEntriesFromSourceRecord(Rec.RecordId);
            ShowWorkflowStatus := CurrPage.WorkflowStatus.PAGE.SetFilterOnWorkflowRecord(Rec.RecordId);
            //StatusStyleTxt := GetStatusStyleText();
            FieldNotEditable();
        end;
        //
        trigger OnOpenPage()
        var
            myInt: Integer;
        begin
            FieldNotEditable();
        end;
        //
        local procedure SetControlAppearance()
        var
            ApprovalsMgmt: Codeunit "Approvals Mgmt.";
            WorkflowWebhookMgt: Codeunit "Workflow Webhook Management";
        begin
            
            OpenApprovalEntriesExistForCurrUser := ApprovalsMgmt.HasOpenApprovalEntriesForCurrentUser(Rec.RecordId);
            OpenApprovalEntriesExist := ApprovalsMgmt.HasOpenApprovalEntries(Rec.RecordId);
            CanCancelApprovalForRecord := ApprovalsMgmt.CanCancelApprovalForRecord(Rec.RecordId);
            WorkflowWebhookMgt.GetCanRequestAndCanCancel(Rec.RecordId, CanRequestApprovalForFlow, CanCancelApprovalForFlow);
            OnAfterSetControlAppearance();
        end;
        //
        var
            OpenApprovalEntriesExistForCurrUser: Boolean;
            OpenApprovalEntriesExist: Boolean;
            ShowWorkflowStatus: Boolean;
            CanCancelApprovalForRecord: Boolean;
            CanRequestApprovalForFlow: Boolean;
            CanCancelApprovalForFlow: Boolean;
            IsEditable: Boolean;
            StatusStyleTxt: Text;
            GeneralMgt: Codeunit "General Management";
        [IntegrationEvent(true, false)]
        local procedure OnAfterSetControlAppearance()
        begin
        end;
        procedure FieldNotEditable()
        var
            PurchInv: Record "Purchase Header";
            UserSetUp: Record "User Setup";
        begin
            IsEditable := true;
            UserSetUp.Reset();
            UserSetUp.SetRange("User ID", UserId);
            UserSetUp.SetRange("Field Not Editable", true);
            If UserSetUp.FindFirst() then Begin
                
                PurchInv.Reset();
                PurchInv.SetRange("No.", Rec."No.");
               
                If PurchInv.FindFirst() then begin
                    
                    If (PurchInv."Posting Date" <> 0D) or (PurchInv."Document Date" <> 0D) or (PurchInv."Due Date" <> 0D) then
                        
                        IsEditable := false;
                end;
            End;
        end;
    }
     
  • Suggested answer
    Mohana Yadav Profile Picture
    61,005 Super User 2025 Season 2 on at
    Please try with this
     
    pageextension 51000 PurchaseInvoice extends "Purchase Invoice"
    {
        layout
        {
            modify("Posting Date")
            {
                Editable = IsEditable;
            }
            modify("Document Date")
            {
                Editable = IsEditable;
            }
            modify("Due Date")
            {
                Editable = IsEditable;
            }
            addafter(Status)
            {
                field("Last Modified At"; Rec.SystemModifiedAt)
                {
                    ApplicationArea = All;
                    Caption = 'Last Modified At';
                    Editable = false;
                }
                field("Last Modified By"; GeneralMgt.GetUserName(Rec.SystemModifiedBy))
                {
                    ApplicationArea = All;
                    Caption = 'Last Modified By';
                    Editable = false;
                }
            }
    
        }
        actions
        {
            modify(SeeFlows)
            {
                Visible = false;
            }
            modify(Category_Category8)
            {
                Caption = 'New caption for Request Approval group';
            }
            modify(SendApprovalRequest)
            {
                Visible = false;
            }
            addafter(SendApprovalRequest)
            {
                action("Send Approval Request")
                {
                    ApplicationArea = Basic, Suite;
                    Caption = 'Send A&pproval Request';
                    Enabled = NOT OpenApprovalEntriesExist AND CanRequestApprovalForFlow;
                    Image = SendApprovalRequest;
                    //Promoted = true;
                    //PromotedCategory = Category8;
                    //PromotedIsBig = true;
                    ToolTip = 'Request approval of the document.';
                    trigger OnAction()
                    var
                        ApprovalsMgmt: Codeunit "Approvals Mgmt.";
                        //PurchH: Record "Purchase Header";
                        PurchLine: Record "Purchase Line";
                        PostedInv: Record "Purch. Inv. Header";
                    begin
                        If ApprovalsMgmt.CheckPurchaseApprovalPossible(Rec) then Begin
                            Rec.Reset();
                            Rec.SetRange("No.", Rec."No.");
                            Rec.SetRange("Document Type", Rec."Document Type"::Invoice);
                            If Rec.FindFirst() then begin
    
                                PurchLine.Reset();
                                PurchLine.SetRange("Document Type", PurchLine."Document Type"::Invoice);
                                PurchLine.SetRange("Document No.", Rec."No.");
                                PurchLine.Setfilter("Amount Including VAT", '=%1', 0);
                                If PurchLine.FindFirst() then Begin
                                    Message('The invoice has zero amount');
                                End
                                Else Begin
                                    ApprovalsMgmt.OnSendPurchaseDocForApproval(Rec);
                                End;
                            End;
                            //
                            PostedInv.Reset();
                            PostedInv.SetRange(PostedInv."Buy-from Vendor No.", Rec."Buy-from Vendor No.");
                            PostedInv.SetRange(PostedInv."Vendor Invoice No.", Rec."Vendor Invoice No.");
                            If PostedInv.FindFirst() then begin
                                Error('Invoice %1 for Vendor %2 already exist and is among the posted invoices. This requires a change in vendor''s invoice number.', Rec."Vendor Invoice No.", Rec."Buy-from Vendor Name");
                            end;
                            //
                        End;
                    End;
                }
    
            }
            addafter(SendApprovalRequest_Promoted)
            {
                actionref(SendApprovalRequestCust_Promoted; "Send Approval Request")
                {
                }
            }
            modify(Approvals)
            {
                Visible = false;
            }
            addafter(CancelApprovalRequest)
            {
                action("View Approvals")
                {
                    AccessByPermission = TableData "Approval Entry" = R;
                    ApplicationArea = Suite;
                    Caption = 'View Approvals';
                    Image = Approvals;
                    //Promoted = true;
                    //PromotedCategory = Category8;
                    ToolTip = 'View a list of the records that are waiting to be approved. For example, you can see who requested the record to be approved, when it was sent, and when it is due to be approved.';
                    trigger OnAction()
                    var
                        ApprovalsMgmt: Codeunit "Approvals Mgmt.";
                    begin
                        ApprovalsMgmt.OpenApprovalsPurchase(Rec);
                    end;
                }
            }
            addafter(CancelApprovalRequest_Promoted)
            {
                actionref(ViewApprovals_Promoted; "View Approvals")
                {
                }
            }
        }
        Trigger OnNewRecord(BelowxRec: Boolean)
        begin
            FieldNotEditable();
        end;
        //
        trigger OnAfterGetCurrRecord()
        begin
            SetControlAppearance;
            CurrPage.IncomingDocAttachFactBox.PAGE.LoadDataFromRecord(Rec);
            CurrPage.ApprovalFactBox.PAGE.UpdateApprovalEntriesFromSourceRecord(Rec.RecordId);
            ShowWorkflowStatus := CurrPage.WorkflowStatus.PAGE.SetFilterOnWorkflowRecord(Rec.RecordId);
            //StatusStyleTxt := GetStatusStyleText();
            FieldNotEditable();
        end;
        //
        trigger OnOpenPage()
        var
            myInt: Integer;
        begin
            FieldNotEditable();
        end;
        //
        local procedure SetControlAppearance()
        var
            ApprovalsMgmt: Codeunit "Approvals Mgmt.";
            WorkflowWebhookMgt: Codeunit "Workflow Webhook Management";
        begin
    
            OpenApprovalEntriesExistForCurrUser := ApprovalsMgmt.HasOpenApprovalEntriesForCurrentUser(Rec.RecordId);
            OpenApprovalEntriesExist := ApprovalsMgmt.HasOpenApprovalEntries(Rec.RecordId);
            CanCancelApprovalForRecord := ApprovalsMgmt.CanCancelApprovalForRecord(Rec.RecordId);
            WorkflowWebhookMgt.GetCanRequestAndCanCancel(Rec.RecordId, CanRequestApprovalForFlow, CanCancelApprovalForFlow);
            OnAfterSetControlAppearance();
        end;
        //
        var
            OpenApprovalEntriesExistForCurrUser: Boolean;
            OpenApprovalEntriesExist: Boolean;
            ShowWorkflowStatus: Boolean;
            CanCancelApprovalForRecord: Boolean;
            CanRequestApprovalForFlow: Boolean;
            CanCancelApprovalForFlow: Boolean;
            IsEditable: Boolean;
            StatusStyleTxt: Text;
            GeneralMgt: Codeunit "General Management";
    
        [IntegrationEvent(true, false)]
        local procedure OnAfterSetControlAppearance()
        begin
        end;
    
        procedure FieldNotEditable()
        var
            PurchInv: Record "Purchase Header";
            UserSetUp: Record "User Setup";
        begin
            IsEditable := true;
            UserSetUp.Reset();
            UserSetUp.SetRange("User ID", UserId);
            UserSetUp.SetRange("Field Not Editable", true);
            If UserSetUp.FindFirst() then Begin
    
                PurchInv.Reset();
                PurchInv.SetRange("No.", Rec."No.");
    
                If PurchInv.FindFirst() then begin
    
                    If (PurchInv."Posting Date" <> 0D) or (PurchInv."Document Date" <> 0D) or (PurchInv."Due Date" <> 0D) then
                        IsEditable := false;
                end;
            End;
        end;
    }
     
  • RomRyan Profile Picture
    on at
    Mohana,
     
    Thanks so much for your time.
    I am getting this error
     
    'Pages with ActionRef syntax' is not available in runtime version '8.0'. The supported runtime versions are: '10.0' or greater.ALAL0666
     
    I suspect it's cause am on run rime 8.0
  • Suggested answer
    Mohana Yadav Profile Picture
    61,005 Super User 2025 Season 2 on at
    Yes, which version of BC are you using?

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,664

#2
YUN ZHU Profile Picture

YUN ZHU 960 Super User 2025 Season 2

#3
Jainam M. Kothari Profile Picture

Jainam M. Kothari 773 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans