Hi,
I develop a class that contains many methods:
public class EUKSecurityPrivilege { #EUKMacro /// <summary> /// Method can verify if Node is an output MenuItem /// </summary> public static boolean isMenuItemOutput(EUKSecurityTreeNode _eukSecurityTreeNode) { boolean isTrue = false; if(_eukSecurityTreeNode != null && _eukSecurityTreeNode.SecurableType == SecurableType::MenuItemOutput) { isTrue = true; } return isTrue; } public str generatePrivilegeName(EUKSecurityTreeNode _eukSecurityTreeNode) { str finalSecurableName = _eukSecurityTreeNode.SecurableName; if (isMenuItemOutput(_eukSecurityTreeNode)) { // Concatenate Prefix Output Menu item with its name finalSecurableName = #MenuItemOutputPrefix + finalSecurableName ; } }
the method generatePrivilegeName calls the method isMenuItemOutput => I get error :
Severity Code Description Project File Line Suppression State
Error The name 'isMenuItemOutput' does not denote a predefined function, a static method on the Global class nor a previously defined local function.
thanks Blue Wang :)
Hi Basma,
Because your method is static, call it by class name. In addition, return is omitted from your generatePrivilegeName() method.
if (Class1::isMenuItemOutput(_eukSecurityTreeNode)) { // Concatenate Prefix Output Menu item with its name finalSecurableName = #MenuItemOutputPrefix + finalSecurableName ; }
Thanks Nikolaos Mäenpää :)
isMenuItemOutput is a static method. So you need to call it like this: "EUKSecurityPrivilege::isMenuItemOutput". If it were not a static method, you would call it like "this.isMenuItemOutput".
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,228 Super User 2024 Season 2
Martin Dráb 230,056 Most Valuable Professional
nmaenpaa 101,156