Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

Open Page in Edit Mode

(0) ShareShare
ReportReport
Posted on by 326

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

  • Suggested answer
    Greg Enns Profile Picture
    Greg Enns 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
    dkkipfer 326 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
    Govinda Kumar 2,198 Super User 2024 Season 1 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
    YUN ZHU 75,848 Super User 2024 Season 2 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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans