set editable listpage by code

PizzamakaPizzamaka Member Posts: 11
edited 2009-06-24 in NAV Three Tier
Hi all.

I have a Problem with a listpage that I would like to set editable from code. In short: It does not work.

When I leave the Editable Property on the default value (yes) I can set Editable to false from code and everything is fine. I would like to do it the other way though: I have a page which is set to editable=false and want to open it from a codeunit where it should be set to editable. This does not work.

The code is this:
pageVar.editable := true;
pageVar.run;

Can anybody help me there?

Comments

  • freddy.dkfreddy.dk Member, Microsoft Employee Posts: 360
    I think what you need to do, is to set Editable on the page to a boolean variable like: pageEditable.
    Remember to add the variable to the dataset (shift F4 on the variable).

    In your sample you should be able to set pageEditable before running the page.
    Freddy Kristiansen
    Group Program Manager, Client
    Microsoft Dynamics NAV
    http://blogs.msdn.com/freddyk

    The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.
  • PizzamakaPizzamaka Member Posts: 11
    Hi freddy.

    Thanks for the reply. Sadly I could not get it to work. This is my setup now:
    Page: editale = no
    page has a global bool var "edit" (included in Dataset)
    page has a function setEdit(bool e)

    a Codeunit with
    pageVar.setEdit( TRUE );
    pageVar.Run;
    in the function I set edit := e
    in the onopen-Trigger I set EDITABLE := edit

    And still no luck...
Sign In or Register to comment.