Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
Trying to add the set preference to my queue menu, but it does not seem to work. Looking for some guidance in ACL.
# create menu
if (!menu_exists('.Window')) {
return;
}
if ( !menu_exists( '.Queue.' ) ) {
menu_add -menu .Window "Queue";
menu_add "Queue." ""Long" cmd "set -preference petransactionoptions = \"queueID:long\""";
menu_add "Queue." ""Short" cmd "set -preference petransactionoptions = \"queueID:short\""";
menu_add "Queue." ""None" cmd "set -preference petransactionoptions = \"queue:yes\""";
}
} # _addmenu()
Thanks
BRyon
Solved! Go to Solution.
I'm a bit rusty myself but I think you are almost there. If it were me I'd simplify it down a little at least for initial testing to get it working? I added my version of this code at the bottom. I used the Help Center as a reference, I haven't tested this in Arbortext yet. BTW, in case you didn't know already you can use the response() command to test out if the -cmd is being called correctly. It will popup a dialog so you can see what it is about to do.
https://support.ptc.com/cs/help/arbortext_hc/ae61_hc/aeAcl/help9122.html
function addQueueMenu() {
if ( !menu_exists( ".Queue." ) ) {
menu_add -menu .Window "Queue";
menu_add .Queue. "Long" -cmd {set -preference petransactionoptions = "queueID:long"};
menu_add .Queue. "Short" -cmd {set -preference petransactionoptions = "queueID:short"};
menu_add .Queue. "None" -cmd {set -preference petransactionoptions = "queue:yes"};
}
}
add_hook("menuloadhook", "addQueueMenu");
Hi Bryon,
This is actually covered in the Arbortext Help Center but long story short you need to use menuloadhook() - see here: https://support.ptc.com/cs/help/arbortext_hc/ae61_hc/aeAcl/help796.html?queryId=173b1b3f891#ATI.759
-Gareth
Thanks for the info Gareth, I am not an ACL kind of guy, more of a hack and slash... or copy and paste...
Something like this?
function _addmenu() {
if ( !menu_exists( '.Queue.' ) ) {
menu_add -menu .Window "Queue";
menu_add "Queue." ""Long" cmd "set -preference petransactionoptions = \"queueID:long\""";
menu_add "Queue." ""Short" cmd "set -preference petransactionoptions = \"queueID:short\""";
menu_add "Queue." ""None" cmd "set -preference petransactionoptions = \"queue:yes\""";
}
} # _addmenu()
# function: _menuloadhook()
function _menuloadhook(win,menupath) {
_addmenu();
} # _menuloadhook()
# function: _addhook()
function _addhook() {
add_hook('menuloadhook',package_name()."::_menuloadhook");
} # _addhook()
Thanks,
Bryon
I'm a bit rusty myself but I think you are almost there. If it were me I'd simplify it down a little at least for initial testing to get it working? I added my version of this code at the bottom. I used the Help Center as a reference, I haven't tested this in Arbortext yet. BTW, in case you didn't know already you can use the response() command to test out if the -cmd is being called correctly. It will popup a dialog so you can see what it is about to do.
https://support.ptc.com/cs/help/arbortext_hc/ae61_hc/aeAcl/help9122.html
function addQueueMenu() {
if ( !menu_exists( ".Queue." ) ) {
menu_add -menu .Window "Queue";
menu_add .Queue. "Long" -cmd {set -preference petransactionoptions = "queueID:long"};
menu_add .Queue. "Short" -cmd {set -preference petransactionoptions = "queueID:short"};
menu_add .Queue. "None" -cmd {set -preference petransactionoptions = "queue:yes"};
}
}
add_hook("menuloadhook", "addQueueMenu");
Thank You Gareth, that works as expected.
Bryon
Just doing some clean up removed the dot before Queue and added the ""
if ( !menu_exists( '.queue.' ) ) {
menu_add -menu .Window "Queue";
menu_add "Queue." "Long" -cmd {set -preference petransactionoptions = "queueID:long"};
menu_add "Queue." "Short" -cmd {set -preference petransactionoptions = "queueID:short"};
menu_add "Queue." "None" -cmd {set -preference petransactionoptions = "queue:yes"};
Thanks again Gareth
Bryon