Skip to main content

Generate Dynamic Drop-down List with SQL Script in Peoplesoft Pages

Hello,

I would like to share my knowledge about how can you create dynamic drop-down list and use in PS pages with some tricks.

Firstly, you need to create new field which must be translate field.



Field length must be four for that field cause we want to use this field with translate values.





Insert this field in a derived record and save it(you don't need to build derived record after saving).



View field properties for new translate field and go to edits tab. Change edit type as table edit and choose translate table edit as bellow;



drag and drop new translate field to a new page and you can see that view of field automatically change like it's a drop-down list.



Save it.

I created a new table to show values;

drop table asdasd;
create table asdasd (seqno number,product varchar2(100 char));
insert into asdasd values(1,'comp');
insert into asdasd values(1,'comp2');
insert into asdasd values(1,'comp3');
insert into asdasd values(1,'comp4');
commit;

and I'm going to use that script;
select seqno,product
from asdasd;

In page activate, type code as bellow;

Local SQL &SQL;
Local Rowset &rset0;
Local string &type, &descr;

/*dönem dropdown list*/
&FLD = GetRecord(Record.IMPRT_GRADE_WRK).GetField(Field.SSR_TERM);
&FLD.ClearDropDownList();
&SQL = CreateSQL("select seqno,product from asdasd;");
While &SQL.Fetch(&descr, &type)
   &FLD.AddDropDownItem(&descr, &type);
End-While;

Finally, you will be able to see values which is result of your select statement in drop-down list in the page.

If you view your field variable restricted, after save your page in App Designer than change field length more than four. So, life will become easier :)

Loves,


Comments

Popular posts from this blog

pg_ctl: command not found

Hi, If you can not reach pg_ctl command in bash also you are sure this command exists in your server, check $PATH. -bash-4.2$ echo $PATH /usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin So, the directory of pg_ctl is not seem in PATH. Input directory of pg_ctl and check it then run it.

PostgreSQL Foreign Data Wrappers

Hi all, I would like to mention about generating Foreign Data Wrappers(FDW) on PostgreSQL 9.6. FDW is used for remote access to tables from external data storage. If needed to use remote table in a query, you can use FDW tables. For instance you can get a table from remote database, but there is a condition. The condition is that user should have proper privileges on FDW table. There is two extension for FDW on PostgreSQL. First one is used for accessing PostgreSQL database to PostgreSQL database, called postgres_fdw . Second one is used for accessing PostgreSQL database to different databases (SQL Server, Sysbase) called tds_fdw .  Foreign Data Wrappers feature lets you to cross-query between remote database tables. Postgres_fdw and tds_fdw has different structure. Tds_fdw usign Tabular Data Stream application layer protocol to transfer data between database server and client. Generating Tds_fdw and Postgres_fdw is similar. I share an example for generating FDW between tw...

PostgreSQL High Availability - Patroni 2

Patroni kurulumuyla ilgili oldukça fazla kaynak bulunmakta fakat kurulum ve yönetimini beraber barındıran kaynağa denk gelmedim. Bu yazıda hem Patroni kurulumu hem de kurulum sonrası yönetimiyle alakalı detaylara ulaşabilirsiniz. PostgreSQL cluster'larının yönetimi için kullanılan Patroni ile ilgili temel bilgilerin yer aldığı Autofailover üzerine hazırladığım yazı serisine aşağıdaki linklerden erişebilirsiniz. PostgreSQL ve Autofailover PostgreSQL'de Autofailover ve Patroni 1 (Giriş) PostgreSQL'de Autofailover ve Patroni 2 (Kurulum, Konfigürasyon ve Yönetim) PostgreSQL'de Autofailover ve Patroni 3 (Mevcut PostgreSQL Cluster'inin Patroni'ye Geçirilmesi) Patroni, PostgreSQL veritabanlarının kurulumundan ve konfigürasyonundan sorumludur. Yani Patroni'yi kurduğumuz sunucular aynı zamanda Patroni ile kurulmuş PostgreSQL'leri barındıracak. Üç node'lu PostgreSQL ve üç node'lu ETCD cluster'larını oluşturacağım. Kuruluma önce üç no...