zoukankan      html  css  js  c++  java
  • Created field method on datasource in AX Form

    with X++ Jobs Created field method on datasource in AX Form

    代码
    static void Jimmy_CreateFieldMethodOnDataSource(Args _args)
    {
    TreeNode tn1,tnAddr, methodsNode;
    MemberFunction memberFunction;
    str source;
    System.Exception clrException;
    ;
    try
    {
    tn1
    = infolog.findNode(
    "\\Forms\\Address\\Data Sources\\Address\\Fields\\AddrRecId");

    tnAddr
    = infolog.findNode( "\\Forms\\Address" );
    methodsNode
    = tn1.AOTfindChild( 'Methods' );
    methodsNode.AOTadd(
    'lookup');
    memberFunction
    = methodsNode.AOTfindChild( 'lookup' );
    source
    = @"public void lookup(FormControl _formControl, str _filterStr)
    {
    super(_formControl, _filterStr);
    }
    " ;
    memberFunction.AOTsetSource(source,
    false);//true is Static method
    memberFunction.AOTsave();
    methodsNode.AOTsave();
    tnAddr.AOTcompile();
    }
    catch( Exception::Error)
    {
    throw exceptionTextFallThrough();
    }
    catch( Exception::CLRError)
    {
    clrException
    = CLRInterop::getLastException();
    if (clrException != null)
    {
    clrException
    = clrException.get_InnerException();
    if (clrException != null)
    {
    error(clrException.get_Message());
    }
    }
    }
    info(
    "Created method successful!" + methodsNode.treeNodePath());
    }
    /*
    Thanks for Max Belugin's comments,
    it is really good to use Verbatim String as well.
    The reason why I use escape characters here is
    because this line of code is copied from standard Axapta application :)
    */

  • 相关阅读:
    FatMouse's Speed --hdu
    poj 1182--食物链 (并查集)
    HDU
    CodeForces
    LightOJ
    HDU2717:Catch That Cow(BFS 队列)
    HDU
    51Nod
    bash: ifconfig: command not found 解决办法--------仅供参考
    关于“ORA-01653: 表 SYS.AUD$ 无法通过 128 (在表空间 SYSTEM 中)
  • 原文地址:https://www.cnblogs.com/Fandyx/p/1750732.html
Copyright © 2011-2022 走看看