Create a new record with a continuous number sequence

Create a new record with a continuous number sequence
Fixed error : System does not support setup 'continuous' of number 
sequence by using command ttsbegin; ... ; ttscommit;  
public void create(boolean _append = false)
{
    NumberSeq           numberSeq;
    NumberSequenceCode  incidentNum;
    Num                 number;
    ;
    super(_append);
    vtvIncidentTable.PrimeClaimRep = CustTable::find(vtvIncidentTable.ShipToCust).MainContactId;
    vtvIncidentTable.VTVCreditAnalyst = CustTable::find(vtvIncidentTable.ShipToCust).VTVCreditAnalyst;
/// get the parameter of Incident 
    incidentNum = NumberSequenceReference::find(typeId2ExtendedTypeId(typeId(VTVIncidentNum))).NumberSequence;
    numberSeq = NumberSeq::newGetNumFromCode(incidentNum);
    ttsbegin;
    vtvIncidentTable.IncidentNum = numberSeq.num();
    ttscommit;
    numberSeq.used();
}
This entry was posted in AX Development. Bookmark the permalink.

Leave a comment