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

Use this Forum to post your “How to …” questions about your use of aXes. This is not a technical support forum. Both the aXes Support Team at LANSA and other aXes customers may answer your questions. LANSA cannot guarantee the accuracy of any information posted by customers.

Moderator: jeanmichel

Post Reply
gracehsu
Posts: 13
Joined: 23 Dec 2022, 04:06

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

Post 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?
Fairdinkum
Posts: 128
Joined: 24 Jul 2017, 17:02

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

Post 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)
Post Reply