Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

·         utxtEmpno is the name given to the field to position to in the form using newlook Designer.

·         uDataGrid Is the name given to the browselist/subfile in the form using newlook Designer.

·          The first column in the data grid contains the Option field.

...

·          The VisualID1 of the Instance List has the employee number.

·          Use option 2 to change the details of an employee selected in the Instance List.

/* Set the value of a variable to that of the selected Employee */

var strCompare = objListManager.VisualId1[0];

/* Set the value of the field in the form to that of the selected Employee */

SETVALUE("utxtEmpno", strCompare);

/* Send an Enter key to cause the list positioning */

SENDKEY(KeyEnter);

/* Get the number of rows in the data grid */

var intRowCount = GETVALUE("uDataGrid.RowCount");

/* Traverse the rows and compare the value of the second column with the one to position to. */

for (var intRowNo = 0; intRowNo < intRowCount; intRowNo++)

{

if ( GETVALUE("uDataGrid.Rows(" + intRowNo + ").Cells(1).Text") == strCompare)
  
   {
  
   /* Type a 2 next to the first entry and press enter */
     
      SETVALUE("uDataGrid.Rows(" + intRowNo + ").Cells(0).Text", 2);
     
      SENDKEY(KeyEnter);
     
      break;
  
   }

}