Friday, May 10, 2013

Export and Import DMS database scripts


Export:
Set output C:\temp\RawData.dat;
Set log C:\temp\RawData.log;

export ABC_RAW_TBL;
export ABC_DATA_TBL;

Import:

set input C:\temp\RawData.dat;
Import *

Check Box Select/Deselect All on Grid


The below function is to be used on a grid with multiple check boxes. Place the code behind a FieldChange event and users will have the option to Select or Deselect grid rows all at once.

Function selectAllRows(&rs As Rowset)
   Local number &i;
   Local Row &row;
   
   For &i = 1 To &rs.ActiveRowCount
      &row = &rs.GetRow(&i);
      /* Make sure we only select visible rows. */
      If &row.Visible = True Then
         &row.Selected = True;
      End-If;
   End-For;
end-function;

/*main line*/
Local Rowset &rs;
&rs = GetLevel0()(1).GetRowset(Scroll.scroll_table);

/*Call Function*/
selectAllRows(&rs);

The same code would work for multiple check boxes "Deselect All", just change the name of the function and line &row.Selected = True; to &row.Selected = False;

Make sure the Multiple Row (Check Box) is checked on the grid properties.

Launch a PSQuery from PeopleSoft webpage


Below delivered function could be used to launch a PSQuery in PS webpage. Place the peoplecode in record rowinit event.

Declare Function CreateQueryURL PeopleCode WEBLIB_QUERY.QRYGENFUNCS FieldFormula;

Your record name.your field name.Value = CreateQueryURL("yuor query name", True);

Example:

Declare Function CreateQueryURL PeopleCode WEBLIB_QUERY.QRYGENFUNCS FieldFormula;

If %Component = Component.ABC_COMPNM_CMP Then
   ABC_COMMON_WRK.URL_1.Value = CreateQueryURL("ABC_PSQRYNM_QRY", True);
End-If;


Thursday, May 9, 2013

Custom sort in Grid


Custom sort of the grid can be achieved by using peoplecode. 

Create a Rowset for the grid and use the below code. 
&RowsetName.Sort(Record.Field1, "D", Record.Field2, "A"); 

The grid is sorted by Field1 in Descending and Field2 in Ascending order. 

Wednesday, May 8, 2013

Search Record and Row Level Security


Using PeopleSoft row-level security views enables you to restrict users from seeing certain rows of data. You can restrict data by:
  • User, by using the OPRID field.
  • Primary permission list, by using the OPRCLASS field.
  • Row security permission list, by using the ROWSECCLASS field.
To implement row-level security through a security view:
  1. In Application Designer, insert one of the three row-level security fields (OPRID, OPRCLASS, ROWSECCLASS) into the record definition.
  2. Configure the field as a Key, but not a List Box Item.
  3. Save the record and build the view.
  4. Use the record as the search record or query security record.
Now, when the user searches, the system dynamically adds a WHERE clause — that incorporates the security field — to the search SELECT statement. The value of the security field is based on the current user.

Monday, May 6, 2013

Oracle SQL Developer problem – enter / backspace / delete button not working – quick fix


To resolve the problem you have to go to:
Tools -> Preferences -> Accelerators -> Load Preset -> Default -> OK

Wednesday, May 1, 2013

PeopleSoft Trace PeopleCode


One can generate a trace while the subscription PeopleCode get executed by using the following two functions in the subscription PeopleCode:
SetTracePC(0);
SetTraceSQL(0);


Example:
SetTracePC(384);
/* REM PeopleCode Statements to be traced */
Local string &St_temp_l;
/* More PeopleCode statements */
SetTracePC(0);