Options

Check via code Page Mode

Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
edited 2011-05-05 in NAV Three Tier
Hi guys!
I've one question for you. Is it possible to check via code how the page is run in a specific moment?
What I want to do is the following:
when I launch an action in a custom page the code will be executed only if the page is in edit mode.
For example:
if EditMode then
  //code1
else
  //code2;
Thx in advance!
~Rik~
It works as expected... More or Less...

Comments

  • Options
    deV.chdeV.ch Member Posts: 543
    I had a similar request, but not edit mode, it was create/new mode. I haven't found any property regarding this, my solution was to check this OnOpen:

    IF NOT Rec2.GET("No.") then
    // => Create Mode

    It's not what you need i know, just wanted to mention if anybody comes across this thread and find it useful.

    But for your problem: have you tried CurrPage.Editable ?
  • Options
    Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    deV.ch wrote:
    I had a similar request, but not edit mode, it was create/new mode. I haven't found any property regarding this, my solution was to check this OnOpen:

    IF NOT Rec2.GET("No.") then
    // => Create Mode

    It's not what you need i know, just wanted to mention if anybody comes across this thread and find it useful.

    But for your problem: have you tried CurrPage.Editable ?

    yes I tried but it doesn't work. I used this code:
    OnAction()
    if currpage.editable then
      message('edit')
    else
      message('view');
    
    but I always obtain "Edit".
    For our customer we found another solution, but could be useful feature if Navision give the possibility to check in which Mode is run the page in a specific moment (maybe in future version :D).
    ~Rik~
    It works as expected... More or Less...
Sign In or Register to comment.