web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Finance forum / method does not denote...
Finance forum

method does not denote a predefined function, a static method on the Global class nor a previously defined local function d365

(0) ShareShare
ReportReport
Posted on by 932

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.

I have the same question (0)
  • Verified answer
    nmaenpaa Profile Picture
    101,172 Moderator on at

    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".

  • BASMA Profile Picture
    932 on at

    Thanks Nikolaos Mäenpää :)

  • Suggested answer
    Blue Wang Profile Picture
    Microsoft Employee on at

    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 ;
    }

    _5563B783_.PNG

  • BASMA Profile Picture
    932 on at

    thanks Blue Wang :)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Finance

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans