Re: Show\Hide Actions in NAV 2013

mfrabottamfrabotta Member Posts: 12
edited 2013-03-08 in NAV Three Tier
Based off user interaction on the form, normally by them selecting an action path, other actions will show or hide.
These actions visibility is controlled by a global Boolean variable, and after they are all set the page is refreshed.



In 2009 this works without a hitch believe it or not.
In 2013 it also works, but I am experiencing some issues.

1. In 2013 the actions, when going from non-visible to visible are small. As if PromotedIsBig is set to false.
This is curious to me, as the property of PromotedIsBig is set to true.
Also, if you were to try to customize the Action Ribbon you are not able to set the "Default Icon Size" as the system does think the PromotedIsBig is set to true.



2. I have actions that I have set to Promoted, but with PromotedIsBig as False, and they are also showing as if I set PromotedIsBig as True.
I am also not able to set the Default Icon Size on these either ... leading me to believe the system is reading the PromotedIsBig as true.

Below, in the code block is the .txt export of a simple page that demonstrates this behavior.
Anyone doing anything like this?

Anyone have any ideas why the actions seem to be ignoring the set parameters in these cases?

I realize that this would most likely not be considered a "Standard" way to do things in Navision.
I get that. I also get that I could make sweeping changes to the concept and do this another way.
In my current experiences however, I believe this to be the most straight forward approach for the end user, and it is already done and working in 2009.

I really appreciate anyone\everyone help on this.

OBJECT Page 50000 Action Issue Example
{
  OBJECT-PROPERTIES
  {
    Date=03/04/13;
    Time=11:06:31 AM;
    Modified=Yes;
    Version List=;
  }
  PROPERTIES
  {
    InsertAllowed=No;
    DeleteAllowed=No;
    SourceTable=Table18;
    DelayedInsert=Yes;
    PageType=Worksheet;
    OnOpenPage=BEGIN

                 m_cdeCurrentState := 'OPEN';
                 SetVisibleOptions();
               END;

    ActionList=ACTIONS
    {
      { 1240520009;  ;ActionContainer;
                      ActionContainerType=ActionItems }
      { 1240520010;1 ;ActionGroup;
                      CaptionML=ENU=Actions }
      { 1240520011;2 ;Action    ;
                      Name=New;
                      Promoted=Yes;
                      Visible=m_blnDisplayActionNew;
                      PromotedIsBig=Yes;
                      Image=New;
                      OnAction=BEGIN
                                 MESSAGE('Override original "New" action.  Do something else.');
                               END;
                                }
      { 1240520012;2 ;Action    ;
                      Name=Delete;
                      Promoted=Yes;
                      Visible=m_blnDisplayActionDelete;
                      PromotedIsBig=Yes;
                      Image=Delete;
                      OnAction=BEGIN
                                 MESSAGE('Override original "Delete" action.  Do something else.')
                               END;
                                }
      { 1240520014;  ;ActionContainer;
                      ActionContainerType=RelatedInformation }
      { 1240520013;1 ;ActionGroup;
                      Name=<Action1240520034>;
                      CaptionML=ENU=Tasks;
                      Visible=False }
      { 1240520015;2 ;Action    ;
                      CaptionML=ENU=Action 1;
                      Promoted=Yes;
                      Visible=m_blnDisplayActionUserSelect1;
                      PromotedIsBig=Yes;
                      Image=Archive;
                      PromotedCategory=Process;
                      OnAction=BEGIN
                                 MESSAGE('Show HiddenFor1 Action');
                                 m_cdeCurrentState := 'FOR1';
                                 SetVisibleOptions();
                               END;
                                }
      { 1240520016;2 ;Action    ;
                      CaptionML=ENU=Action 2;
                      Promoted=Yes;
                      Visible=m_blnDisplayActionUserSelect2;
                      PromotedIsBig=Yes;
                      Image=AnalysisView;
                      PromotedCategory=Process;
                      OnAction=BEGIN
                                 MESSAGE('Show HiddenFor2 Action');
                                 m_cdeCurrentState := 'FOR2';
                                 SetVisibleOptions();
                               END;
                                }
      { 1240520018;2 ;Action    ;
                      CaptionML=ENU=Hidden For 1;
                      Promoted=Yes;
                      Visible=m_blnDisplayActionHiddenFor1;
                      PromotedIsBig=Yes;
                      Image=CheckLedger;
                      PromotedCategory=Process;
                      OnAction=BEGIN
                                 MESSAGE('This action was originally hidden.  Is should be PromotedIsBig = TRUE.  Why am I small.');
                               END;
                                }
      { 1240520019;2 ;Action    ;
                      CaptionML=ENU=Hidden For 2;
                      Promoted=Yes;
                      Visible=m_blnDisplayActionHiddenFor2;
                      PromotedIsBig=Yes;
                      Image=PhysicalInventory;
                      PromotedCategory=Process;
                      OnAction=BEGIN
                                 MESSAGE('This action was originally hidden.  Is should be PromotedIsBig = TRUE.  Why am I small.');
                               END;
                                }
      { 1240520021;2 ;Action    ;
                      CaptionML=ENU=Reset Actions;
                      Promoted=Yes;
                      Visible=m_blnShowReset;
                      PromotedIsBig=Yes;
                      Image=ResetStatus;
                      PromotedCategory=Process;
                      OnAction=BEGIN
                                 MESSAGE('Reset actions.');
                                 m_cdeCurrentState := 'OPEN';
                                 SetVisibleOptions();
                               END;
                                }
      { 1240520017;1 ;ActionGroup;
                      Name=<Action1240520025>;
                      CaptionML=ENU=Show|Hide Information;
                      ActionContainerType=NewDocumentItems }
      { 1240520020;2 ;Action    ;
                      CaptionML=ENU=Another Action;
                      Promoted=Yes;
                      Visible=m_blnDisplayActionAlways;
                      Image=CreatePutAway;
                      PromotedCategory=Category5;
                      OnAction=BEGIN
                                 MESSAGE('Some other action that has PromotedIsBig = FALSE.  Why am I big.');
                               END;
                                }
    }
  }
  CONTROLS
  {
    { 1240520001;0;Container;
                ContainerType=ContentArea }

    { 1240520002;1;Group  ;
                Name=Group;
                GroupType=Repeater }

    { 1240520003;2;Field  ;
                SourceExpr="No." }

    { 1240520004;2;Field  ;
                SourceExpr=Name }

    { 1240520005;2;Field  ;
                SourceExpr=Address }

    { 1240520006;2;Field  ;
                SourceExpr=City }

    { 1240520007;2;Field  ;
                SourceExpr=County }

    { 1240520008;2;Field  ;
                SourceExpr="Post Code" }

  }
  CODE
  {
    VAR
      m_blnDisplayActionNew@1240520001 : Boolean INDATASET;
      m_blnDisplayActionDelete@1240520002 : Boolean INDATASET;
      m_blnDisplayActionUserSelect1@1240520003 : Boolean INDATASET;
      m_blnDisplayActionUserSelect2@1240520004 : Boolean INDATASET;
      m_blnDisplayActionHiddenFor1@1240520005 : Boolean INDATASET;
      m_blnDisplayActionHiddenFor2@1240520006 : Boolean INDATASET;
      m_blnDisplayActionAlways@1240520007 : Boolean INDATASET;
      m_blnShowReset@1240520009 : Boolean INDATASET;
      m_cdeCurrentState@1240520008 : Code[10];

    PROCEDURE SetVisibleOptions@1240520001();
    BEGIN

      m_blnDisplayActionNew := (m_cdeCurrentState IN ['OPEN']);
      m_blnDisplayActionDelete := (m_cdeCurrentState IN ['OPEN']);
      m_blnDisplayActionUserSelect1 := (m_cdeCurrentState IN ['OPEN']);
      m_blnDisplayActionUserSelect2 := (m_cdeCurrentState IN ['OPEN']);
      m_blnDisplayActionHiddenFor1 := (m_cdeCurrentState IN ['FOR1']);
      m_blnDisplayActionHiddenFor2 := (m_cdeCurrentState IN ['FOR2']);
      m_blnShowReset := m_blnDisplayActionHiddenFor1 OR m_blnDisplayActionHiddenFor2;
      m_blnDisplayActionAlways := TRUE;
    END;

    BEGIN
    END.
  }
}

Comments

  • FoxhoundFoxhound Member Posts: 1
    I've got the same problem here!

    Find out that the icons that start visible are showed as big and the icons that start visible = false are showed small..

    but i did not find a solution yet.
  • mfrabottamfrabotta Member Posts: 12
    Foxhound,

    Neither have I. The best I have come up with is to change the actions from being Enabled\Disabled.
    This is rather cheesy though, as I am showing actions that may or may not be available.

    Another issue I am seeing is action that are Promoted, but IsBig false, are still showing up big.

    It is a sad day when 2009 R2 renders better!

    Hopefully you have better luck solving this one, as I would really like to to work as expected.
    Please let me know if you find any alternatives.

    mfrabotta
Sign In or Register to comment.