Monday, November 11, 2013

PeopleSoft: Get the names of Properties in a CI


The following piece of code would fetch the name of the Properties, of a Component Interface,  upto level 2.

   &MYSESSION = %Session;
   &CI = &MYSESSION.GetCompIntfc(CompIntfc.NS_CI);


   &PROPINFO_0 = &CI.PropertyInfoCollection;
       /*Level0 Properties*/   For &I = 1 To &PROPINFO_0.Count;
      &PROPITEM_0 = &PROPINFO_0.Item(&I);
      Warning (&PROPITEM_0.Name);


      If (&PROPITEM_0.IsCollection) Then
         &PROPINFO_1 = &PROPITEM_0.PropertyInfoCollection;


         /*Level1 Properties*/
         For &J = 1 To &PROPINFO_1.Count;
            &PROPITEM_1 = &PROPINFO_1.Item(&J);
            &S1 = &PROPITEM_0.Name | "." | &PROPITEM_1.Name;
            Warning (&S1);


            If (&PROPITEM_1.IsCollection) Then
               &PROPINFO_2 = &PROPITEM_1.PropertyInfoCollection;


           /*Level2 Properties*/               For &K = 1 To &PROPINFO_2.Count;
                  &PROPITEM_2 = &PROPINFO_2.Item(&K);
                  &S1 = &PROPITEM_0.Name | "." | &PROPITEM_1.Name | "." | &PROPITEM_2.Name;
                  Warning (&S1);


               End-For;
            End-If

         End-For;
      End-If;
   End-For;

No comments:

Post a Comment