Hi Guys,
Today i would like to share you , how to create a number sequence record through code including format .
Write this below code in a job and execute ,
NumberSequenceTable numberSeqTable;
NumberSequenceScope numberSeqScope;
container segments;
str annotatedFormat, format;
;
select numberSeqScope
where numberSeqScope.DataArea = = 'LOC';
segments += [[0, 'LOC']];
segments += [[-1,'-']];
segments += [[-2,'######']];
annotatedFormat = NumberSeq::createAnnotatedFormatFromSegments(segments);
format = NumberSeq::createAnnotatedFormatFromSegments(segments, false);
numberSeqTable.clear();
numberSeqTable.NumberSequence = 'PROJ';
numberSeqTable.Txt = 'Test';
numberSeqTable.AnnotatedFormat = annotatedFormat;
numberSeqTable.NumberSequenceScope = numberSeqScope.RecId;
numberSeqTable.Format = format;
numberSeqTable.Highest = 999999;
numberSeqTable.Lowest = 1;
numberSeqTable.NextRec = 1;
numberSeqTable.insert();
Today i would like to share you , how to create a number sequence record through code including format .
Write this below code in a job and execute ,
NumberSequenceTable numberSeqTable;
NumberSequenceScope numberSeqScope;
container segments;
str annotatedFormat, format;
;
select numberSeqScope
where numberSeqScope.DataArea = = 'LOC';
segments += [[0, 'LOC']];
segments += [[-1,'-']];
segments += [[-2,'######']];
annotatedFormat = NumberSeq::createAnnotatedFormatFromSegments(segments);
format = NumberSeq::createAnnotatedFormatFromSegments(segments, false);
numberSeqTable.clear();
numberSeqTable.NumberSequence = 'PROJ';
numberSeqTable.Txt = 'Test';
numberSeqTable.AnnotatedFormat = annotatedFormat;
numberSeqTable.NumberSequenceScope = numberSeqScope.RecId;
numberSeqTable.Format = format;
numberSeqTable.Highest = 999999;
numberSeqTable.Lowest = 1;
numberSeqTable.NextRec = 1;
numberSeqTable.insert();
Thanks & Regards,
Banupriya.S
No comments:
Post a Comment