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

Open Page in Edit Mode

(0) ShareShare
ReportReport
Posted on by 317

I am trying to open the Service Order card page in edit mode for a record on a list page based on a temporary table. Even when setting the page to Editable, the page opens in View mode.

Any help would be appreciated!

local procedure ShowSVCO()
    var
        pageSVCO: page "Service Order";
        svcorec: Record "Service Header";
    begin
        if Rec.DocType = Rec.DocType::SVCO then begin
            svcorec.Reset();
            svcorec.SetRange("Document Type", svcorec."Document Type"::Order);
            svcorec.SetRange("No.", Rec."No.");
            if svcorec.Find('-') then begin
                pageSVCO.SetRecord(svcorec);
                pageSVCO.Editable(true);
                pageSVCO.Run();
            end

Categories:
  • Suggested answer
    Greg Enns Profile Picture
    1,102 on at
    RE: Open Page in Edit Mode

    Maybe try running the debugger to see if another extension is overriding your code?

  • dkkipfer Profile Picture
    317 on at
    RE: Open Page in Edit Mode

    This does not work either for some reason. The only way I have been able to get it working is if I use RunModal on the page run.

  • Suggested answer
    Govinda Kumar Profile Picture
    2,193 Moderator on at
    RE: Open Page in Edit Mode

    Hi,

    You cannot make the page editable dynamically and then open it, as YUN ZHU mentioned above you have to use CurrPage,Editable. Just run the specific code and remove 'pageSVCO.Editable(true)' from your procedure and extend the service document page 5900 to add 'CurrPage.Editable(true)' to the 'onOpenPageTrigger'.

    pastedimage1682485707256v3.png

    pastedimage1682485666867v2.png

    Regards

  • Suggested answer
    YUN ZHU Profile Picture
    62,477 Moderator on at
    RE: Open Page in Edit Mode

    Hi, please use CurrPage.Editable(true) in the OnOpenPage trigger.

    https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/page/page-editable-method

    pastedimage1682467289049v1.png

    More details: https://yzhums.com/9132/

    Hope this helps.

    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

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard >

Featured topics

Product updates

Dynamics 365 release plans