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. MySQL(24):事务的隔离级别

    1. 事务的隔离级别引入: 数据库是多线程并发访问的,所以很容易出现多个线程同时开启事务的情况,这样的就会出现脏读.重复读以及幻读的情况.在数据库操作中,为了有效保证并发读取数据的正确性,需要为事务设 ...

  2. 测试 IE 浏览器兼容性 VirtualBox + modern.ie

    VirtualBox 是开源的虚拟机软件,常用的虚拟机软件还有 VMware / Hyper-V / Paralles Desktop . modern.ie 是微软官方提供的用于测试网页在各版本 I ...

  3. Android开发——实现固定在ScrollView顶部的View,类似于新浪微博的评论列表的顶部

    现在很多App都实现了这个功能,例如新浪微博评论页面的评论.转发.赞的数字可以固定在屏幕上方.我个人很喜欢这种设计,所以利用一点空余时间简单实现了一个类似的功能. 先来看一下上面这张图的效果 这个是新 ...

  4. 实用技术——Eclipse 常用快捷键

    Eclipse的编辑功能非常强大,掌握了Eclipse快捷键功能,能够大大提高开发效率. 和编辑相关的快捷键 Eclipse中有如下一些和编辑相关的快捷键.  1. [ALT+/]  此快捷键为用户编 ...

  5. 典型的字符串处理代码(page50)

    Page50: public class TypicalString{//典型的字符串处理代码 public static boolean isPlalindrom(String s){//判断字符串 ...

  6. javascript中Math ceil(),floor(),round()三个函数的对比

    Math.ceil()执行的是向上舍入 Math.floor()执行向下舍入 Math.round()执行标准舍入 一下是一些补充: ceil():将小数部分一律向整数部分进位. 如: Math.ce ...

  7. 改变WPF ListBoxItem的选中样式

    想用ListBox作一个类似IOS 设置的菜单,却发现很难改变ListBoxItem鼠标移过.选中的默认蓝色背景与边框. 尝试使用Style来设置strigger,依然不成功.在百度搜索一些资料,提到 ...

  8. 用pf透明地将流量从一台机器转到另一台机器上的缘起及实现方式对比

    下面是也是我在12580工作时发生的事情,重新记录并发出来.这种特殊需求很考 验PF的功底.在新旧系统并存,做重构的时候有时很需要这种救急的作法.一.缘起miscweb1(172.16.88.228) ...

  9. 10 Interesting Linux Command Line Tricks and Tips Worth Knowing

    I passionately enjoy working with commands as they offer more control over a Linux system than GUIs( ...

  10. AndroidStudio开发工具快捷键

    在这里,自己整理了下在使用AndroidStudio开发工具所使用到的一些快捷键提示,也出于在开发过程中节省时间提升效率,然而可能多数开发者之前使用的都是Eclipse开发工具,可能开始都不习惯,但是 ...