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 :)
    */

  • 相关阅读:
    Gin+Gorm小项目
    python实现监控信息收集
    Vue引入Stylus
    Go搭建一个Web服务器
    saltstack高效运维
    04-01 Django之模板层
    03-01 Django之视图层
    02-01 Django之路由层
    HTTP协议
    01-01 Web应用
  • 原文地址:https://www.cnblogs.com/Fandyx/p/1750732.html
Copyright © 2011-2022 走看看