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. iOS 生成随机数 重复 不重复

    //编程的时候,有三条任选执行路径,都会显示一些图片,比如路径1显示的图片是一个人,路径2显示的是两个人,路径3显示任意人数的图片,要求每次进入该页面都不能重复初始的那张图片. 于是我想到了 运用随机 ...

  2. IT项目技术建议书核心内容

    第一部分:概述部分 该部分的重点是理解标书,理解项目建设的背景,建设该项目的初衷究竟是什么?需要解决的核心关键问题是什么?基于对项目的理解然后明确项目建设的目标,项目建设的原则,项目本事的定位,项目建 ...

  3. Oracle基础 物理备份 冷备份和热备份(转)

    一.冷备份介绍:    冷备份数据库是将数据库关闭之后备份所有的关键性文件包括数据文件.控制文件.联机REDO LOG文件,将其拷贝到另外的位置.此外冷备份也可以包含对参数文件和口令文件的备份,但是这 ...

  4. 如何使用 SQL Developer 导出数据

    完成此方法文档后,您应该能够了解: 如何使用 SQL Developer 将数据导出为各种文件格式 如何导出模式中的对象定义 目录 1. 简介 2. 软件要求 3. 导出数据 4. 导出对象定义 5. ...

  5. HDU 1003 Max Sum && HDU 1231 最大连续子序列 (DP)

    Max Sum Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Sub ...

  6. noi 97 积木游戏

    思路:黑书的例题 #include<map> #include<set> #include<cmath> #include<queue> #includ ...

  7. web性能瓶颈

    1.网络,网络不好,其他做得再好,性能也是问题. 其中包括自己的带宽和请求的数量,带宽是我们无法控制的.我们能做的是尽可能的减少不必要的请求. 2.服务器,一个产品,服务器是关键,所有的请求都要经过服 ...

  8. php学习笔记2--安装apache遇到的问题

    下载apache之后,以管理员身份运行cmd:1.httpd -k install2.httpd -k start出现无法运行的问题,可能的原因是443端口已被占用.在我的机器中是因为安装了VMwar ...

  9. Part 13 Create a custom filter in AngularJS

    Custom filter in AngularJS 1. Is a function that returns a function 2. Use the filter function to cr ...

  10. MySQL中DATE_FORMATE函数内置字符集解析

    今天帮同事处理一个SQL(简化过后的)执行报错: 代码如下 复制代码 mysql> select date_format('2013-11-19','Y-m-d') > timediff( ...