Thursday, July 10, 2014

Number Sequence Error in AX 2012

While creating new number sequence we may come across this error "Default scope cannot be implicitly determined by the number sequence framework for the given datatype. Please provide scope information explicitly."

This generally comes when there is a conflict in a scope which is being entered in NumberSeqModule class and later changed fix this issue by below steps

*Please try this in testing environment first this will impact currently running number sequence as well

1. Find the EDT number which is conflicting
2. Run below job with EDT number
static void delteDatatyperef(Args _args)
{
    NumberSequenceDatatypeParameterType NumberSequenceDatatypeParameterType;
    NumberSequenceDatatype      NumberSequenceDatatype,lNumberSequenceDatatype;
    
    RefRecId    RefRecId = 105035;
    
    select NumberSequenceDatatype where NumberSequenceDatatype.DatatypeId == RefRecId;
    ttsBegin;
    delete_from NumberSequenceDatatypeParameterType where NumberSequenceDatatypeParameterType.NumberSequenceDatatype == NumberSequenceDatatype.RecId;
    delete_from lNumberSequenceDatatype where lNumberSequenceDatatype.DatatypeId == RefRecId;
    ttsCommit;
    

}

3. Run NumberSeqApplicationModule.load(); in another job as per module which is conflicting 

All will be working fine after this.