Create number sequence record through code including format in AX 2012

NumberSequenceTable   numberSeqTable;
NumberSequenceScope  numberSeqScope;
container                         segments;
str                                   annotatedFormat, format;
;
select  numberSeqScope
       where numberSeqScope.DataArea == 'QYS';

segments += [[0, 'QYS']];
segments += [[-1,'-']];
segments += [[-2,'######']];

annotatedFormat  = NumberSeq::createAnnotatedFormatFromSegments(segments);
format                  = NumberSeq::createAnnotatedFormatFromSegments(segments, false);

numberSeqTable.clear();
numberSeqTable.NumberSequence           = '111';
numberSeqTable.Txt                                 = 'Test';
numberSeqTable.AnnotatedFormat           = annotatedFormat;
numberSeqTable.NumberSequenceScope = numberSeqScope.RecId;
numberSeqTable.Format                           = format;
numberSeqTable.Highest                           = 999999;
numberSeqTable.Lowest                           = 1;
numberSeqTable.NextRec                         = 1;
numberSeqTable.insert();

转自:https://axcorner.blogspot.com/2013/12/create-number-sequence-record-through.html



    Danzel
    Danzel管理员

    • 声明:本文由Danzel于2024-04-15转载(优化),转载须经原站同意并注明出处。
    • 本文地址:http://maryd.cn/?id=290
    上一篇:Dynamics ax 2012 x++可能永远也用不到
    下一篇:将网址打包生成windows的exe程序

    留言评论

    暂无留言
    取消
    扫码支持