Click to Rate and Give Feedback
MSDN
MSDN Library
Microsoft Dynamics
Reference
Classes
Map Class
 Map.exists Method
Collapse All/Expand All Collapse All
Microsoft Dynamics AX 2009
Map.exists Method

Determines whether a particular value exists as a key in the map.

public boolean exists(anytype keyValue)

Called

Parameter

Description

keyValue

The value for which to check.

true if the specified key value exists in the map; otherwise, false.

Use this method to guard calls to the Map.lookup method. If the Map.lookup method does not find the value it is looking for, it throws an exception.

The following example checks whether a particular style exists in a map of styles in a style sheet. If it does, a new name is substituted for the body style.

static void renameStyle(Map stylesheet, str fromName, str toName)
{
    str body;
    ;
    if (stylesheet.exists(fromName))
    {
        body = stylesheet.lookup (fromName);
        stylesheet.remove (fromName);
        stylesheet.insert (toName, body);
    }
    else
    {
        info (fromName);
    }
} 
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker