Ignore best practice errors

Temporary to check in object

1. Set break point at the end of method
\Classes\SysTreeNode\allowCheckIn
And in debugger change return value from false to true.
2. Set Accept in Version Control -> General -> Best practice settings -> Best practice errors. Check object in and then restore previous setting.

Permanently

Add new entry to SysBPCheckIgnore marcos. Please be aware that changes in SysBPCheckIgnore will take affect only after client restart.
SysBPCheckIgnore marco is really heavy and takes long time to load and in most cases will hang the system when you try to compare it.
It is reasonable to make your own version of this macro.
There is how you can do that
1. Create your own macro: SLNSysBPCheckIgnore
2. Duplicate following method and give it name like SLNinitIgnoreMap
\Classes\SysBPCheck\initIgnoreMap
3. Make changes as in bold to newly created method:
public static void SLNinitIgnoreMap(XppPrePostArgs _args)
{
->  #define.IgnoreMacro("\\macros\\SLNSysBPCheckIgnore")
    int             errorCode;
    str             errorCodeStr;
    TreeNodePath    path;
    Set             set;
    Set             ignoreSet;
    SetEnumerator   enum;
    XmlReader       xmlReader;
    Map             errorCodeMap = new Map(Types::String, Types::Integer);
    TreeNode        macroNode;
->  TreeNode        bpIgnoreMacroNode = TreeNode::findNode(#IgnoreMacro);
->  //TreeNode        bpStyleExceptionsMacroNode = TreeNode::findNode(#pathForStyleExceptionList);
    Array           macroArray = new Array(Types::Class);
    int             i;
->  SysBPCheck      sysBPCheck = _args.getThis();
->  Map             ignoreMap;

->  //ignoreMap = new Map(Types::Integer, Types::Class);
->  ignoreMap       = sysBPCheck.parmIgnoreMap();

    if (!bpIgnoreMacroNode)
    {
->      throw error("@SYS28152", #IgnoreMacro);
    }

->  //if (!bpStyleExceptionsMacroNode)
->  //{
->  //    throw error("@SYS28152", #pathForStyleExceptionList);
->  //}

    macroArray.value(1, bpIgnoreMacroNode);
->  //macroArray.value(2, bpStyleExceptionsMacroNode);
4. Add new Post Event Handler Subscription at method
\Classes\SysBPCheck\initIgnoreMap
And point it to SLNinitIgnoreMap created in previous steps

Job to reload SysBPCheckIgnore macro without client restart.

static void sysBPCheckIgnoreReload(Args _args)
{
    SysCompilerOutput::updateParm();
}

Search

About

DaxOnline.org is free platform that allows you to quickly store and reuse snippets, notes, articles related to Dynamics AX.

Authors are allowed to set their own AdSense units.
Join us.

Blog Tags