How to create a number sequence in Axapta?

本文详细介绍了在Axapta中创建数字序列的具体步骤,包括设置基本参数、启用使用按钮、创建EDT和表格、设计表单以及确认模块集成等关键环节。

According as a test, the below detail can create a number sequence in Axapta.

1, Basic->Setup->Number Sequences-> Number Sequence Form.

Create a NS code such as "SN_TEST" from 1 to 999999 and format is SN_######.

2, Create a job to enable InUse button.

    NumberSequenceTable  _ns ;
    ttsbegin ;
    while select forupdate  _ns where _ns.NumberSequence == 'SN_Test'
    {
        _ns.InUse = NoYes::Yes ;
        _ns.update() ;
    }
    ttscommit ;

3, Create an EDT named 'IDTest' and extends is num.

4, Create a table named HDSH_SNTest and has two field, one is IdTest (EDT is IDTest) and another is name (EDT is name)

5, Create a Form and DS is HDSH_SNTest. Display two fields in a Grid

6, First confirm which module do want to add this SN. Such as Production. Pls look for a class name 'NumberSeqReference_Production'

In protected void loadModule() method add the code as below:

 

    numRef.dataTypeId              = typeId2ExtendedTypeId(typeid(IdTest));    // from EDT
    numRef.referenceHelp           = literalstr("NS Test");
    numRef.WizardContinuous        = false;
    numRef.WizardManual            = NoYes::Yes;
    numRef.WizardAllowChangeDown   = NoYes::No;
    numRef.WizardAllowChangeUp     = NoYes::No;
    numRef.sortField               = 9;                                              // is order

    this.create(numRef);                                                                 // create a SN in parameter of production

7, In DS of HDSH_SNTest form, Add the below code:

public void initValue()
{

    super();
    HDSH_SNTest.IdTest  = Numberseq::newGetNum(prodparameters::numRefSNId()).num() ;

}

 

OK, all are OK.

posted on 2008-09-18 14:08 Jacky Xu 阅读( ...) 评论( ...)   编辑 收藏

转载于:https://www.cnblogs.com/JackyXu1981/articles/1293294.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值