top of page

How to check multiple rows are selected in IFS C#

Writer's picture: Rumesh Aponso (RMAX)Rumesh Aponso (RMAX)

Example 1:

public virtual SalNumber NumberOfRows() {    
   #region Local Variables
   SalNumber nRows = 0;
   SalNumber nCurrentRow = 0;
   #endregion

   #region Actions
   using (new SalContext(this))
   {
       nCurrentRow = Sys.TBL_MinRow;
       if (Sal.TblAnyRows(this, Sys.ROW_Selected, 0))
       {
           while (true)
           {
               if (Sal.TblFindNextRow(this, ref nCurrentRow, Sys.ROW_Selected, 0))
               {
                   nRows = nRows + 1;
               }
               else
               {
                   break;
               }
           }
           return nRows;
       }
       else
       {
           return 0;
       }
   }
   #endregion
}

private void cmdShowDetails_Inquire(object sender, Fnd.Windows.Forms.FndCommandInquireEventArgs e)
{
   #region Actions
   if (NumberOfRows() > 1)
   {
       ((FndCommand)sender).Enabled = false;
       return;
   }
   ((FndCommand)sender).Enabled = true;
   #endregion
}

Example 2:

private void cmdShowDetails_Inquire(object sender, Fnd.Windows.Forms.FndCommandInquireEventArgs e)
{
   #region Local Variables
   SalNumber nRow = Sys.TBL_MinRow;
   #endregion

   #region Actions
   using (new SalContext(this.cChildTableDetail))
   {
       nRow = Sys.TBL_MinRow;
       if (this.cChildTableDetail.FindNextRow(ref nRow, Sys.ROW_Selected, 0))
       {
           if (this.cChildTableDetail.FindNextRow(ref nRow, Sys.ROW_Selected, 0))
           {
               ((FndCommand)sender).Enabled = false;
           }
           else
           {
               ((FndCommand)sender).Enabled = true;
           }
       }
   }
   #endregion
}

2 views0 comments

Related Posts

See All

Fnd Dynamic Tab Page in IEE Client

[FndWindowRegistration("YVVDA_COMPANY_ADDR", "YvvdaCompanyAddr", FndWindowRegistrationFlags.HomePage)] [FndDynamicTabPage("frmCompanyAddr...

LISTAGG in PLSQL

Example 1: SELECT DISTINCT LISTAGG(t.commission_receiver, ';') WITHIN GROUP (ORDER BY t.commission_receiver) FROM...

Get Foundation Error from ORA Error

FUNCTION Strip_Ora_Error ( sqlerrm_        IN VARCHAR2,    sqlcode_        IN NUMBER DEFAULT NULL,    strip_ora_only_ IN BOOLEAN DEFAULT...

Comments


Copyright © 2025 RMAXOneNote

  • Online CV
  • LinkedIn
  • Youtube
  • GitHub
  • Blogger
bottom of page