Particular option shown

I have two field 1st is Department and 2nd is Document both have same data types Option but i want when i select particular department then limited document shown not shown all the document how to do that

Comments

  • RockWithNAVRockWithNAV Member Posts: 1,139
    Can you please elaborate a bit more??
  • Jeegen_PrajapatiJeegen_Prajapati Member Posts: 22
    ex. when i select the HR department in drop down list then in document drop down list only HR Related value will e shown.

    like when we select USA in country drop down list then very next drop down list only shown city that is in USA no other country's city was displayed.
  • m_bergerm_berger Member Posts: 7
    You'll have to code your own lookup in the OnLookup trigger if you want it dependent on the value of another one.
  • RockWithNAVRockWithNAV Member Posts: 1,139
    Yep as @m_berger said, you need to write code on the OnLookup trigger where based in your codition the look up will keep changing.
  • DuikmeesterDuikmeester Member Posts: 308
    edited 2017-03-09
    You can create multipe Fields of the page each with a select number of OptionString and show them depending the Department choosen.
    OBJECT Page 60000 Demo
    {
      OBJECT-PROPERTIES
      {
        Date=;
        Time=;
        Version List=;
      }
      PROPERTIES
      {
      }
      CONTROLS
      {
        { 1000000000;;Container;
                    ContainerType=ContentArea }
    
        { 1000000001;1;Field  ;
                    SourceExpr=Departments;
                    OnValidate=BEGIN
                                 DepAVisible := Departments = Departments::"Dep A";
                                 DepBVisible := Departments = Departments::"Dep B";
                                 DepCVisible := Departments = Departments::"Dep C";
                               END;
                                }
    
        { 1000000002;1;Field  ;
                    Name=DocumentsA;
                    OptionCaptionML=ENU=Dep A Doc 1,Dep A Doc 2,Dep A Doc 3;
                    SourceExpr=Documents;
                    Visible=DepAVisible }
    
        { 1000000003;1;Field  ;
                    Name=DocumentsB;
                    OptionCaptionML=ENU=,,,Dep B Doc 1,Dep B Doc 2,Dep B Doc 3;
                    SourceExpr=Documents;
                    Visible=DepBVisible }
    
        { 1000000004;1;Field  ;
                    Name=DocumentsC;
                    OptionCaptionML=ENU=,,,,,,Dep C Doc 1,Dep C Doc 2,Dep C Doc3;
                    SourceExpr=Documents;
                    Visible=DepCVisible }
    
      }
      CODE
      {
        VAR
          Departments@1000000000 : 'Dep A,Dep B,Dep C';
          Documents@1000000001 : 'Dep A Doc 1,Dep A Doc 2,Dep A Doc 3,Dep B Doc 1,Dep B Doc 2,Dep B Doc 3,Dep C Doc 1,Dep C Doc 2,Dep C Doc3';
          DepAVisible@1000000002 : Boolean;
          DepBVisible@1000000003 : Boolean;
          DepCVisible@1000000004 : Boolean;
    
        BEGIN
        END.
      }
    }
    
    
  • lubostlubost Member Posts: 628
    Code
    DepAVisible := Departments = Departments::"Dep A";
    DepBVisible := Departments = Departments::"Dep B";
    DepCVisible := Departments = Departments::"Dep C";
    should be in OnAfterGetRecord and OnAfterGetCurrRecord triggers due to appropriate showing fields during traversing records. In OnAfterValidate triggers should be CurrPage.UPDATE command only.
Sign In or Register to comment.