We had an interesting requirement to implement Auto-tab functionality in PeopleSoft. In a grid with 3 columns, ( Say Field ABC, Field MNO, Field PQR from record XYZ each having length of 3 Character), when user will start inserting data in Field ABC, after entering 3 characters the cursor should automatically move to Field MNO and so on.
Approach:
To make generic solution, we added following piece of javascript code in delivered PT_EDITSCRIPT HTML definition:
/* Custom JavaScript Function */
function autotab(original,destination){
if (original.getAttribute&&original.value.length==original.getAttribute("maxlength"))
destination.focus()
return "";
}
And then added an HTML area in the requested page with a constant value as below:
and it worked well !
Wednesday, March 25, 2009
Friday, March 20, 2009
Random Password Generation
Many a times we generate random password for user in PeopleSoft ( eg. New Oprid) and then send this auto-generated password via Email. In PeopleCode, we can use the Rand function to generate a random number greater than or equal to 0 and less than 1. For example:
&password="ABC" | Int(Rand( )*1000);
In case we want to generate random password using SQL ( say in Set-based processing) we can use DBMS_RANDOM package in Oracle.
SELECT DBMS_RANDOM.STRING('P', 10) FROM PS_INSTALLATION;
(Reference: Generating random numbers and strings in Oracle)
&password="ABC" | Int(Rand( )*1000);
In case we want to generate random password using SQL ( say in Set-based processing) we can use DBMS_RANDOM package in Oracle.
SELECT DBMS_RANDOM.STRING('P', 10) FROM PS_INSTALLATION;
(Reference: Generating random numbers and strings in Oracle)
Tuesday, March 10, 2009
About Fields
How can we find...
a) Type of a field ?
b) Attributes of a field in a record ( Key Field, Search Key Field, Required Field, etc... [Everything what we see in a record field property]) ?
c) Default value of a record-field ?
d) Prompt Table, Set Control Field associated with a record-field ?
e) and many such field/record-field attributes?
Prime source of information would be: PSDBFIELD, PSRECDEFN, PSRECFIELDALL, PSRECFIELDDB. However there are other tables (including Lang tables) which we might use based on our requirements but these 4 tables are being used more frequently.
If you wish to know how to work with USEEDIT, references are:
a) App Package EOEW: App Class Common-- Nicely written.
b) The Mystical USEEDIT -- Wisely explained.
*********************************************************************************
Update For 8.50 (11/11/2009)
Two new features have been added in 8.50 in terms of Record Field property:
a) Prompt Search Event
b) Type Ahead
Following Sql can be used to determine if these properties are set for ant record-field:
SELECT
A.RECNAME,
A.FIELDNAME,
CASE
WHEN bitand(A.USEEDIT, 134217728) > 0 THEN
'YES'
END AS PromptSearchEvent,
CASE
WHEN bitand(A.USEEDIT, 1073741824) > 0 THEN
'YES'
END AS TypeAhead
FROM PSRECFIELD A,
PSDBFIELD B
WHERE A.RECNAME = 'PS_ABC_TBL'
AND B.FIELDNAME='XYZ'
AND A.FIELDNAME = B.FIELDNAME
a) Type of a field ?
b) Attributes of a field in a record ( Key Field, Search Key Field, Required Field, etc... [Everything what we see in a record field property]) ?
c) Default value of a record-field ?
d) Prompt Table, Set Control Field associated with a record-field ?
e) and many such field/record-field attributes?
Prime source of information would be: PSDBFIELD, PSRECDEFN, PSRECFIELDALL, PSRECFIELDDB. However there are other tables (including Lang tables) which we might use based on our requirements but these 4 tables are being used more frequently.
If you wish to know how to work with USEEDIT, references are:
a) App Package EOEW: App Class Common-- Nicely written.
b) The Mystical USEEDIT -- Wisely explained.
*********************************************************************************
Update For 8.50 (11/11/2009)
Two new features have been added in 8.50 in terms of Record Field property:
a) Prompt Search Event
b) Type Ahead
Following Sql can be used to determine if these properties are set for ant record-field:
SELECT
A.RECNAME,
A.FIELDNAME,
CASE
WHEN bitand(A.USEEDIT, 134217728) > 0 THEN
'YES'
END AS PromptSearchEvent,
CASE
WHEN bitand(A.USEEDIT, 1073741824) > 0 THEN
'YES'
END AS TypeAhead
FROM PSRECFIELD A,
PSDBFIELD B
WHERE A.RECNAME = 'PS_ABC_TBL'
AND B.FIELDNAME='XYZ'
AND A.FIELDNAME = B.FIELDNAME
Subscribe to:
Posts (Atom)