Search This Blog

Sunday, August 19, 2012

App Designer Login Issues

Problem: Not able to change peopletools objects from App designer.
Resolution: Need to add "PeopleSoft Administrator" role to the userid.

Problem: Invalid username/password while logging to App designer.
Resolution: check the TNS entries placed in Orahome (Place where oracle software is installed) /network/admin folder. See that the SID , port and domain are correct.

Problem; Want to change the default PS logo.
Resolution: One quick way is to create an image object of same dimension (usually 145 x 41) , and upload through App designer.



Friday, March 9, 2012

Hiding a row in a grid

&rs(&i).visible=false;

"rs" is the rowset of the grid. i.e &rs = getrowset(sroll.RECNAME);
"i" -- represents row of the grid.
 Let us take a scenario where we want to hide employee rows who are contractors
Sample grid data
Sno   Emplid  Name  EmpType
1       14201   Kiran      P 
2       14202   Krishna  C
3       14203   Ravi       P   

Now , I want to hide Contractor. In this case it is Krishna.
So I will traverse through the rowset

Buffer values of the grid before hiding the rows.
1 Kiran
2 Krishna
3 Ravi

for &i=1 to &rs.activerowcount

if  &rs(&i).EMP_HIRE_DTL.EMP_TYPE = "C" then
&rs(&i).visible = false; 
end-if;
end-for;

Buffer values of the grid after hiding the rows.

1 Kiran
2 Ravi
3 Krishna

Hope the above info is useful.

Tuesday, January 24, 2012

Extracting file details from unix into peoplesoft

There are some cases where we would like to get the File details like timestamp etc from unix server into peoplesoft.

There are different approaches that we can follow to get file details from unix file server.

1. Use Shell script and write file attributes like owner,filename,lastupddttm etc to another file and then
    call this script from peoplecode Exec function.
2. User shell script and write file attributes to database record and then call this record from peoplecode.
3. Use Java language file class concept. Like instantiate the Java file object and then call the javamethod from   peoplecode to get the file attributes.

Let us see the first approach.

1. Use Shell script and write file attributes like owner,filename,lastupddttm etc to another file and then
    call this script from peoplecode Exec function.
 a) Create a shell script and execute from server to check the correctness of the script.
     pseudocode:
     Get the file details using ls -ltr command and store the output to variable
     Write these variables to a file.
b)  since we need file attributes of a particular file from a particular env, pass the filename and env as input.
c)  Use exec command from peoplecode and execute the script.
One challenge is in getting the file datetime values. In unix, ls -ltr will give file datetime till hours and mins but not secs.
Example: Abc.txt  Jan 14 5:29 but there are chances file might get overriden during the same time like 5:29 14 secs might get overriden at 5:29 42 secs. We cannnot find this using the ls -ltr command.  
To overcome this , use the perl script which will give the time till secs.

Thus we can get the file attributes from the above steps. Hope the info is useful.






Preserve case parameter in addattachment function

Below post is helpful to those who have encountered an issue with the file extension getting converted to lower case  instead of retain the same.

We use add_attachment(list_of_param....) to upload files to the server.
Inside the Add_attachment(list_of_param....) function there is a builtin library function addattachment(list_of_param....) which actually uploads the file in the server.

There is one parameter called preserve case which helps to retain the extension which user had uploaded.
By default, it is set to false.
That means if user uploaded "Test_File.TXT" , the file name on the server will be "Test_File.txt".

There could some cases where you feel the extension of the file should not change.
In that case , change the value to 'true'.

AddAttachment(URLDestination, DirAndFilename, FileType, UserFile[, MaxSize]                                                                     [, PreserveCase, UploadPageTitle])

Above syntax is from tools version 8.49