Suppose we want create number sequence for Test field on form in General  ledger module
Consideration: EDT-Test, Table-TestTable and Form- TestTable
 
Step1. Create new EDT with name Test
Step 2. Modify load module() method on  NumberSeqModuleLedger class
 
{
     datatype.parmDatatypeId(extendedTypeNum(Test));
     datatype.parmReferenceHelp(literalStr("Test"));
     datatype.parmWizardIsManual(NoYes::No);
     datatype.parmWizardIsChangeDownAllowed(NoYes::No);
     datatype.parmWizardIsChangeUpAllowed(NoYes::No);
     datatype.parmWizardHighest(999);
     datatype.parmSortField(30);
     datatype.addParameterType(NumberSeqParameterType::DataArea, truefalse);
     this.create(datatype);
}
 
Step 3.Create a method on LedgerParameters Table
 
     client server static NumberSequenceReference numRefTest()
{
     return NumberSeqReference::findReference(extendedTypeNum(Test));
}
 
Step 4.Write and run following job
 
static void NumberSeqLoadAll(Args _args)
{
    NumberSeqApplicationModule::loadAll();
 
}
 
 
Step 5.Then run the wizard
 
Organization Administration -> CommonForms -> Numbersequences->Numbersequences-> Generate -> run the wizard.
 
Step 6.Now we have to check the number sequence  is correctly working  for that write a job:
 
static void NumSeq(Args _args)
{
    NumberSeq  numberSeq;
    Test num;
    ;
    numberSeq = NumberSeq::newGetNum(ProjParameters:: numRefTest ());
    num = numberSeq.num();
    info(num);
}
 
 
Step 7.Now we want that Number Sequence in form level(Test Table):
 
 
 Write below code in class declaration  
public class FormRun extends ObjectRun
{
    NumberSeqFormHandler numberSeqFormHandler;
 
}
 
 Step 8.Write the NumberSeqFormHandler() in form methods node.
 
NumberSeqFormHandler numberSeqFormHandler()
{
    if (!numberSeqFormHandler)
    {
       numberSeqFormHandler = NumberSeqFormHandler::newForm(LedgerParameters:: numRefTest ().NumberSequenceId,
                                                             element,
                                                             TestTable_DS,
                                                             fieldNum(TestTable, Test)
                                                            );
    }
    return numberSeqFormHandler;
}
 
 
Step 9.Write the  Create(),Delete(),Write() , Validate Write(),Link Active() on the Data source methods node.
 Create() Method
void create(boolean append = false,
            boolean extern = false
{
    element.numberSeqFormHandler().formMethodDataSourceCreatePre();
 
    super(append);
 
    if (!extern)
    {
        element.numberSeqFormHandler().formMethodDataSourceCreate(true);
    }
}
 
Delete() Method
 
public void delete()
{
    element.numberSeqFormHandler().formMethodDataSourceDelete();
    super();
}
 
Write()Method
 
public void write()
{
    super();
    element.numberSeqFormHandler().formMethodDataSourceWrite();
}
 
 
 
Validate Write() Method
 
public boolean validateWrite()
{
    boolean         ret;
    ret = super();
    ret = element.numberSeqFormHandler().formMethodDataSourceValidateWrite(ret) && ret;
    if (ret)
    {
        TestTable.validateWrite();
    }
    return ret;
}
 
Link Active() Method
 
public void linkActive()
{
    ;
    element.numberSeqFormHandler().formMethodDataSourceLinkActive();
    super();
}
Step 10.Finally add Close() method on form
void close()
{
    if (numberSeqFormHandler)
    {
        numberSeqFormHandler.formMethodClose();
    }
    super();
}
 
AX2009 version such as:

How to generate number Sequence[AX 2012]的更多相关文章

  1. [AX]AX2012 Number sequence framework :(三)再谈Number sequence

    AX2012的number sequence framework中引入了两个Scope和segment两个概念,它们的具体作用从下面序列的例子说起. 法国/中国的法律要求财务凭证的Journal nu ...

  2. Extended Data Type Properties [AX 2012]

    Extended Data Type Properties [AX 2012] This topic has not yet been rated - Rate this topic Updated: ...

  3. Select Statement Syntax [AX 2012]

    Applies To: Microsoft Dynamics AX 2012 R3, Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 ...

  4. Overview of Form Control Types [AX 2012]

    Overview of Form Control Types [AX 2012] Other Versions 0 out of 1 rated this helpful - Rate this to ...

  5. Understanding the RelationshipType Enumeration [AX 2012]

    Understanding the RelationshipType Enumeration [AX 2012] 3 out of 3 rated this helpful - Rate this t ...

  6. Table Properties [AX 2012]

    Table Properties [AX 2012] 1 out of 2 rated this helpful - Rate this topic Updated: July 20, 2012 Ap ...

  7. Base Enum Properties [AX 2012]

    Base Enum Properties [AX 2012] This topic has not yet been rated - Rate this topic Updated: December ...

  8. HDU 4390 Number Sequence 容斥原理

    Number Sequence Time Limit: 10000/3000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) ...

  9. Dynamics AX 2012 的工业物联网解决方案

    Dynamics AX 2012 的工业物联网解决方案 物联网 物联网的概念在这两年非常火,包括近期很火的共享单车初创公司--摩拜单车,在产品中运用了Azure Iot物联网技术.但是,物联网并不是一 ...

随机推荐

  1. DML 数据操控语言

    一.DML数据操作语言  (DQL  select ) 主要用于检索.插入和修改数据库信息.它是最常用的SQL命令,如INSERT(插入).UPDATE(更新).SELECT(选择).DELETE(删 ...

  2. 改成 否“依然报LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏”问题的解决

    LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏 . 这个bug说实话,还是挺让人蛋疼的!!! 问题发生原因: 我这里能跑2013+opencv24 ...

  3. C++构造/析构/赋值函数

    在编写C++程序的时候,我们会为特定某一类对象申明类类型,几乎我们申明的每一个class都会有一个或多个构造函数.一个析构函数.一个赋值运算符重载=.以及拷贝构造函数.这些函数控制着类对象的基础操作, ...

  4. mybatis--MapperProxy事务

    上篇 详细分析了org.mybatis.spring.mapper.MapperScannerConfigurer 和 org.mybatis.spring.SqlSessionFactoryBean ...

  5. Shodan!

    Shodan! 简介 首先先介绍一下Shodan CNNMoney的一篇文章写道,虽然目前人们都认为谷歌是最强劲的搜索引擎,但Shodan才是互联网上最可怕的搜索引擎. 与谷歌不同的是,Shodan不 ...

  6. ruby学习--block

    #当前块 class Block def a_method return yield if block_given? 'no block' end end obj=Block.new puts &qu ...

  7. Android开发的十项注意

    随着移动平台的发展及其应用的不断改善,质量成为决定成败的关键.用户要求他们安装的应用响应快.性能好,如果某个应用不能提供卓越的功能和稳定的用户体验,那注定会被很快卸载: 尽管现在Android智能手机 ...

  8. 英特尔® 实感™ SDK 前置摄像头 (F200) 常见问题解答

    原文地址 https://software.intel.com/zh-cn/articles/intel-realsense-sdk-faq-for-front-facing-camera-f200? ...

  9. HTML的FORM的元素

    form是是HTML的一个重要元素. form的常用控件有 单行文本框<input type="text" value="text" name=" ...

  10. .net framework缓存遍历

    背景: 公司的老框架里的登录信息用的MemoryCache保存的,为了实现单用户登录(即一个账号不能同事登录),需要在登录前对已经登录的信息做遍历. 大致思路如下: 本方法可用于清除所有的缓存. 1. ...