Sunday 10 March 2019

Peoplecode to check if field contains spaces or punctuation


If All(PTSF_SRCH_ENGN.PTSF_SRCH_ENG_INS.Value) Then
   &Name = PTSF_SRCH_ENGN.PTSF_SRCH_ENG_INS.Value;
   &I = 1;
   If IsAlphaNumeric(&Name) = False Then
      While &I <= Len(&Name)
         /* Test to see if failure is because of _ or - or not*/
         &testchar = Substring(&Name, &I, 1);
         If (IsAlphaNumeric(&testchar) = True) Or
               (&testchar = "_") Or
               (&testchar = "-") Then;
            &I = &I + 1;
         Else
            Error (MsgGetText(78, 33, "no spaces or punctuation are allowed"));
            &I = Len(&Name);
            Break;
         End-If;
      End-While;
   Else
      /* test for number in first position*/
      &testnumberpos1 = Substring(&Name, 1, 1);
      If IsDigits(&testnumberpos1) = True Then
         Error (MsgGetText(78, 33, "no spaces or punctuation are allowed"));
         &I = Len(&Name);
      End-If;
   End-If;
End-If;

Tuesday 12 February 2019

Flush data from Component Buffer in a Grid




In my case , I am flushing the grid data on field change of Qualification field

Local Rowset &Xlat;

/* --- Flush Elective Grid on Qualification Field Change --- */

&Xlat = GetRowset(Scroll.X_ELECTIVE_INFO);


&Xlat.Flush();