Page 1 of 1

is there any way to load a quick pick via a static table?

Posted: 31 May 2025, 00:13
by gracehsu
I'm making a custom extension. I CAN load it manually, but we have a table on the system where we add any options we have coded, is there any way to load the option from the table?

Re: is there any way to load a quick pick via a static table?

Posted: 04 Feb 2026, 12:34
by Fairdinkum
Hi,

You can implement the Quick Pick Menu with static or dynamic tables using the following code:

*This is an example using a dynamic table.


(items) *DynamicMode*

Code: Select all

var r = [];
var t = "CUSTP"; //動的テーブル名
TABLEMANAGER.loadDynamicTable(
    t,
    USERENV.dynamicTablesFile,
    {
        /*Optional for SQLVariables*/
    },
    false
);
var q = TABLEMANAGER.getTable(t);
/*
 * itemsプロパティの caption として取得
 */
r.push({"caption": ""});
for ( var i = 0; i < q.childCount(); i ++ ){
    r.push(
        {
            "caption": q.child(i).value + ":" + q.child(i).text
        }
    )
}
ENV.returnValue = r;

(onItemSelection)

Code: Select all

var t = "CUSTP"; //動的テーブル名
var q = TABLEMANAGER.getTable(t);

/*
 * ENV.itemNumber... 1, 2, 3, ..., n
 * q.child.......... 0, 1, 2, ..., n
 */
if ( ENV.itemNumber <= 1 ){
    FIELD.setValue("");
}else{
    FIELD.setValue(q.child(ENV.itemNumber-2).value);
}

HTH.


Regards,
Hide (from Fairdinkum)