is there any way to load a quick pick via a static table?
Moderator: jeanmichel
is there any way to load a quick pick via a static table?
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?
-
Fairdinkum
- Posts: 128
- Joined: 24 Jul 2017, 17:02
Re: is there any way to load a quick pick via a static table?
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*
(onItemSelection)
HTH.
Regards,
Hide (from Fairdinkum)
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)