CompShack Blogs

Unsupported Grafcap device - SQR 6458

When I try to run a custom developed SQR program, which has a bar chart, the error ”Unsupported Grafcap device –SQR 6458” was reported by the SQR engine.. Even when I tried with bar100.sqr program, which is a delivered SQR, the same error exists. Later I found the solution. There are three things to be considered while running any program with bar/pie/histogram etc.
a).stimages.dll
b).Libsti.ini
c).SQR File Path

a).Stimages.dll

Code to know whether the Scheduled App Engine ran to success or not

  If &MYRQST.Status = 0 Then /* if Schedule status is success */

      &LOOP = 0;
      While &LOOP = 0
         SQLExec("SELECT A.DISTSTATUS, A.RUNSTATUSDESCR FROM PS_PMN_PRCSLIST A WHERE A.PRCSNAME = :1 AND A.PRCSINSTANCE = (SELECT MAX(B.PRCSINSTANCE) FROM PS_PMN_PRCSLIST B WHERE B.PRCSNAME = A.PRCSNAME)", &MyAppName, &POSTED, &STATUS);
         
         If &STATUS = "Success" And
               &POSTED = 5 Then /* Posted */
            &LOOP = 1
         End-If;
         
         If &STATUS = "Success" And /* Not Posted */

Code to Schedule App Engine thru PeopleCode

Local ProcessRequest &MYRQST;
   
   &MyAppName = "CSGC_OL_RVW";
   &MYRQST = CreateProcessRequest("Application Engine", &MyAppName);
   &MYRQST.RunControlID = "TEST";
   &MYRQST.RunLocation = "PSUNX";      
   &MYRQST.Schedule();
   
   If &MYRQST.Status = 0 Then /* if Schedule status is success */
 
  End-If;

Sending Outlook Meeting Request Using PeopleCode

The code was provided by a guest by the name of Nate. I wanted to post the code as a blog entry to give it more visibility. The original forum question is http://compshack.com/forum/peoplesoft/peoplesoft-technical/sending-meeti...

I haven't used/tested the code, so please provide your feedback in the comments section below if you have.

import PT_MCF_MAIL:*;

/*Declare variables*/
Local Record &cache = CreateRecord(Record.Z_CAL_CACHE);
Local string &guid;
Local string &url;

Count Occurrence of a Character in a String

I had the need to count an occurrence of a specific character in a string and after tossing some ideas back and forth between a couple of my colleges, we came up with the below two SQLs. You pass a string and identify the character you are looking to count its occurrence. In both SQLs below, I'm trying to count how many times does ">>" exists in string "This is>>a string>>to look into>>". The answer of course is 3 times.

SQL Option 1:

SELECT COUNT (*)
 FROM (SELECT SUBSTR ('This is>>a string>>to look into>>', ROWNUM, 2 ) s,
              ROWNUM pos

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)

SQL beautifier

Here comes a sql beautifier web site for the readers who don’t know about this.

We can format the sql in a second by using this. Give a try and will see the difference in sql. Useful to understand the sql in easier way.

http://www.dpriver.com/pp/sqlformat.htm

Regards,
Hari.A

SQL practise - Online

Here is an online SQL learning website with Interpreter

http://sqlcourse.com/create.html

This will be useful for all beginners.

Regards,
Hari.A

Updating Own Information in PeopleSoft

Many of you have might see an Error - Not able to update own data on PS delivered components

"You are not allowed to upadte your own data
You attempted to save a record containing an EMPLID field whose value matched the value defined in your operator profile.Contact other authorized user to update your data or contact your system adm."

Here is a quick way to overide that

Open the RowInit PeopleCode on the EMPLID field

AllowEmplidChg(true);

N Vision manual

Nvision user manual

Regards,
Hari.A