PeopleSoft - Technical

Running an SQR from within your PeopleCode program

Therefore, the best and safest way to launch an SQR program is to use the People Code functions CreateProcessRequest() and Schedule(). The CreateProcessRequest function allows you to create a Process Request object. Remember, you should be coding your People Code programs using the Object Oriented methods. Once you’ve created your object, you can assign values to its properties and use the Schedule method to submit the process request for scheduling. The CreateProcessRequest function takes 2 arguments. The Process Type and the Process Name.

REM Declare your Variables;

Emplid increment automatically

Hi Friends,

For scenario like i want to increase Emplid value when am click search page automatically.

It is possible in Rowinit Peoplecode.

Sample Code:
If %mode = "A" then /*A Means add mode */
SQLExec("Select max(Emplid) from ps_abc",&a); /* &a is a variable */
&a=&a+1;
PS_ABC.Emplid.value=&a;
gray(PS_ABC.Emplid);
end-if;

Regards,
Mahendra

How can we romove multiple duplicate rows of data printing under each Print command in SQR Program?

Hi Friends.

Instead of Print command, by using String.So that we can get each and every row one time in either CSV/HTML/XML output format.

Example:
Print $Name(,)
Print $Name (,)
Print $Address2(,)
Print $State (,)
Print $Country(,) /* Use Strings here to remove multiple duplicate rows of data*/
STRING $Name $Address1 $Address2 $State $Country BY ',' INTO $ST1
STRING $N ,............................................................ BY ',' INTO $ST2
STRING $ST1 $ST2 BY ',' INTO $ST3
PRINT $ST3 (+1,1)

Regards,
Mahendra

How can we call Dynamic Calling section in Peoplesoft Application Engine program?

Hi Friends,

Calling Dynamic Sction Dynamically:

Open Application engine program and insert the section with action(action like call section).Here select the Dynamic Calling check box,then open Peoplecode action with OnExecute event and write the Dynamic calling section Peoplecode like....

Evaluate Recrod.Field ----- Evaluate PS_JOB.EMPLID
WHEN "N"
PS_JOB.AE_SECTION.Value="VALIDALL" /*Call here which sction is required to retrieve the data*/
Break;
WHEN = "Y"
PS_JOB.AE_SECTION.Value = 'LOADDATA' /*Call here loading data sction*/
Break;
End-Evaluate;

Regards,
Mahendra

How can we write multiple SQL Commands/Statements under one Action by using one function?

Hi Friends,

Yes,we can write multiple SQL Statements by using %Execute Function.(Pls refer in Peoplbooks if required).

Example: Scenario1:
Open one SQL Action.............
%EXECUTE (/)
UPDATE PS_JOB SET NAME='PEOPLESOFT' WHERE NAME1='HRMS';
/
INSERT INTO PS_JOB VALUES('NAME','EMPID','HOME',................);
/
DELETE PS_JOB WHERE ROWNUM=10;
Note: Here forwardslash is optional to commit the statment.

Scenario2:
%EXECUTE()
UPDATE PS_JOB SET NAME='PEOPLESOFT' WHERE NAME1='HRMS';
COMMIT;
INSERT INTO PS_JOB VALUES('NAME','EMPID','HOME',................);
COMMIT;

Difference between Custom and Customised objects in Peoplesoft?

Hi All,
Custom Objects in PeopleSoft: Custom objects are the objects built by a PeopleSoft client to accommodate their business needs.
Customized Objects in PeopleSoft: Customized objects are the delivered objects from PeopleSoft to which the client made some changes to accommodate their business requirements.

If am wrong please correct me.

Regards,
Mahendra

Query to Retrieve all Records under a Specific Component

Following is the query that can be useful to find out all records under a specified component. All it requires is the component name, and type of record you want to check For example pass value as "0" to retrieve only record type as 'Table' under specified component

SELECT DISTINCT (recname)
FROM psrecdefn
WHERE recname IN
(SELECT DISTINCT (recname)
FROM pspnlfield
WHERE pnlname IN
(SELECT DISTINCT (b.pnlname)
 FROM pspnlgroup a, pspnlfield b
WHERE (   a.pnlname = b.pnlname OR a.pnlname =b.subpnlname)