Skip to main content

Notifications

Announcements

No record found.

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

Open Page in View Mode instead of edit mode when open from list page

Posted on by 50

Hi,

When we double click on Item list page it opens the item card in editable mode.

How can I assure that when users double click on a line in a Item List Page, Item  Card opens in view mode?

I checked previous posts but couldn't find any answer. Its for Nav 2017

  • Jeroen Kooi Profile Picture
    Jeroen Kooi 17 on at
    RE: Open Page in View Mode instead of edit mode when open from list page

    Hello!

    This is my first comment, because the company I work for had this same issue (older people working with two screens and didn't knew they were in the item card for example) and it's not very hard to do this. You do need a developer licence and development environment at your disposal

    Just make a function in a codeunit (for example 50000) and name it DoubleClickView.

    Property Local to 'No'

    Parameter RecordRef (i've named my parameter pRecRef)

    Locals:

    Record: Customer (I've named mine lRecCustomer)

    Record: Vendor (I've named mine lRecVendor)

    Record Item (I've named mine lRecItem)

    You can add more records for every listpage you want to open as View instead of editable

    Add following code:

    CASE pRecRef.NUMBER OF

     18 : BEGIN

       pRecRef.SETTABLE(lRecCustomer);

       PAGE.RUN(21,lRecCustomer);

     END;

     23 : BEGIN

       pRecRef.SETTABLE(lRecVendor);

       PAGE.RUN(26,lRecVendor);

     END;

     27 : BEGIN

       pRecRef.SETTABLE(lRecItem);

       PAGE.RUN(30,lRecItem);

     END;

    END;

    Now, there is one more thing you should do. Go to the listpage and go to the Page Actions. Add a new Action 'DoubleClickView'

    Property: Visible = False. RunPageMode = View. Image = View. ShortCutKey = Return

    Local: RecordRef (for exmaple lRecRef)

    Code:

    lRecRef.GETTABLE(Rec);

    YourCodeunit.DoubleClickView(lRecRef);

    Et voíla

    Kind regards

  • Verified answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Open Page in View Mode instead of edit mode when open from list page

    Unfortunately you cannot set mode in this scenario, you can set that if it is an action but not it opens based on CardPageID of the Item List Page, you could control the editable property of the page by setting CurrPage.EDITABLE to false and then add an action to the Item Card Page to set that value to true again

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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans