Showing posts with label PeopleCode. Show all posts
Showing posts with label PeopleCode. Show all posts

How will you implement level 4 while designing a page?


With the delivered PeopleTools design it is not possible to implement a level 4. You can only have upto level 3. The allowed levels are
1. Level 0
2. Level 1
3. Level 2
4. Level 3

But often there will be business scenario where you need to show a child level data corresponding for a level 3. In such scenarios you can use other alternative workarounds to display Level 4 data. One of the most popular workaround is to create a secondary page and provide a push button or hyperlink which will open the secondary page modally. The secondary page have data or grids with no auto select option. Now you can pass the keys of your level 3 data with the help of a work record. Now based on the values in the work record, you can fill the data in the secondary page on the PageActivate event.

If your level 4 has many nested childs or complicated logics, you can think of a new component and can open that component modally.

Yet this is just one of the workaround, you can have your own methods to display level 4 data. But one thing is sure, you need to manually handle level 4 data, PeopleTools will not provide any data handling method/property/functions for supporting level 4.

What are the built-functions used to control translate values dynamically?

Adddropdownitem()

Deletedropdownitem()

Write the syntax to access third level record field using object oriented peoplecode?

If you know the row number in advance use below. Note I have put row number as 1 for all the levels.

&fld=Getlevel0()(1).GetRowset(Record.<level1 record>.GetRow(1), 
                                 GetRowset(Record.<level2record>).GetRow(1),
                                  GetRowset(Record.<level3 record>).GetRow(1),

                                  GetRecord(Record.<level3 record>).GetFieild(Field.<field name>));

To loop through and find the field use below code.

&rsLvl0 = GetLevel0();


For &I = 1 to &rsLvl0.ActiveRowCount

 &rsLvl1 = &rsLvl0.GetRow(&I).GetRowset(Scroll.LEVEL1_REC);

    For &J = 1 To &rsLvl1.ActiveRowCount

      &rsLvl2 = &rsLvl1.GetRow(&J).GetRowset(Scroll.LEVEL2_REC);

        For &K= 1 To &rsLvl2.ActiveRowCount

          &rsLvl3 = &rsLvl2.GetRow(&K).GetRowSet(Scroll.LEVEL3_REC);

            For &L = 1 To &rsLvl3.ActiveRowCount

              &Rec3 = &rsLvl3.GetRow(&L).GetRecord(Record.LEVEL3_REC);
              &Field = &Rec3.FIELD_NAME;

              rem Now do your processing;
           End-For;
      End-For;
   End-For;
End-For;

What is differed processing and its advantages?

Postpones some user actions to reduce the number of trips to the database so that increases the performance (in system edits, field edit, and field change).

Advantages:
1)     Reduces the network traffic.

2)     Increases the performance.

Can you save the component programmatically?

Using Dosave and Dosavenow functions.

What is difference between Getrowset and Createrowset in people code?

     Getrowset –is used to get rowset for a record in the component buffer.


    Createrowset—is used to create rowset for a record which in database, and is also called a     Standalone rowset

. What is an array in people code? What is maximum dimension of an array? Which function inserts values into an array? What is “pop”?

An array is a collection of data storage locations, each of which holds the same type of data.

 The maximum depth of a PeopleCode array is 15 dimensions.


 Push and unshift are the functions of the array used to add the elements into the array one from the end of the array and one from the beginning.

  Pop is a function of array used to select and delete an element from the end of the array.

What is Getlevel0()? What is the use of %subrec and %selectall functions?

Getlevel0()---used the get the rowset of the level0.

 %subrec--is used only in Dynamic View SQL where it expands to the columns of a subrecord:


 %selectall--%SelectAll is shorthand for selecting all fields in the specified record, wrapping date/time fields with %DateOut, %TimeOut.

What is difference between field default and Row init?

Field default specifies only the default value for a field when we are in Add mode.


Row init fires only when a row of data coming from database to component buffer

What is default processing?

In default processing, any blank fields in the component are set to their default  value. You can specify the default value either in the Record Field Properties, or in FieldDefault PeopleCode.

If the field is already having a value then no default processing happens. If the record field is having a default value and the field is empty when component is loaded, the the value is defaulted based on the record field property. If both of the cases fail, then the component processor will execute the Field Default event and try to get a value. Note: Field default is executed only if a) field doesnot have a value and b) the record field property has no default defined.

What are different variables in people code and their Scope?

System variables and User defined variables.


 Scope ---Global, Component, Local.     

When we select a component what events will be fired?

If default mode for component is search mode: only searchinit will fired


If default mode for component is new mode :field default, field formula, rowinit, searchinit.

What databuffer classes are available in people code?

Rowset, Row, Record, Field, Array, File, Sql, chart, grid and so on.

What is the difference between component buffer and data buffer?

Component buffer contains all the data of the active component.

Data buffer contains the data other than the data in the component buffer (Data of other records)

What are the options for using SQL in people code?

         a) sqlexec

         b) Record class methods (selectbykey,delete,insert,update)


         c) Using sql class, its properties and methods.

How is the searchinit event most often used by people soft application?

Searchinit fires before the search dialogue page is displayed to the end user.For this reason searchinit is often used to enhance roll level security by inserting and graying out certain values to the search dialogue page.

What is the purpose of the SQLEXEC function? What are its benefits and draw backs?

SQLEXEC is used to execute the sql statements(select,insert,update,delete).

        We can get only one row at a time.

Is there any way by which you can find out whether the user is in Add mode or Update mode?

%mode---returns A---for Add mode.


 Returns U –for Update mode

In which events error & warning are used most extensively.

Field edit, Save edit, Search save, row delete, row insert

What are think time functions?

Think-time functions suspend processing either until the user has taken some action (such as clicking a button in a message box), or until an external process has run to completion.