Wednesday, December 3, 2008

Creation of number sequence for project

public class NumberSeqReference_Project extends NumberSeqReference
{

}

/*
Detailed description of how to setup references for number sequences can
be found i method loadModule() on the 'father' class: numberSeqReference.
*/
protected void loadModule()
{
    NumberSequenceReference numRef;

    numRef.DataTypeId              = typeId2ExtendedTypeId(typeid(ProjId));
    numRef.ReferenceHelp           = literalstr("@SYS53891");
    numRef.WizardManual            = NoYes::No;
    numRef.WizardAllowChangeDown   = NoYes::No;
    numRef.WizardAllowChangeUp     = NoYes::No;
    numRef.WizardHighest           = 999999;
    numRef.SortField               = 1;

    this.create(numRef);

    numRef.DataTypeId              = typeId2ExtendedTypeId(typeid(ProjNormalInvoiceId));
    numRef.ReferenceHelp           = literalstr("@SYS53894");
    numRef.WizardContinuous        = true;
    numRef.WizardManual            = NoYes::No;
    numRef.WizardAllowChangeDown   = NoYes::No;
    numRef.WizardAllowChangeUp     = NoYes::No;
    numRef.GroupEnabled            = NoYes::Yes;
    numRef.SortField               = 4;

    this.create(numRef);

    numRef.DataTypeId              = typeId2ExtendedTypeId(typeid(ProjProposalId));
    numRef.ConfigurationKeyId      = configurationkeynum(ProjBasicTimeMaterial);
    numRef.ReferenceHelp           = literalstr("@SYS53895");
    numRef.WizardContinuous        = true;
    numRef.WizardManual            = NoYes::No;
    numRef.WizardAllowChangeDown   = NoYes::No;
    numRef.WizardAllowChangeUp     = NoYes::No;
    numRef.SortField               = 6;

    this.create(numRef);

    numRef.DataTypeId              = typeId2ExtendedTypeId(typeid(ProjOnAccInvoiceId));
    numRef.ReferenceHelp           = literalstr("@SYS53896");
    numRef.WizardContinuous        = true;
    numRef.WizardManual            = NoYes::No;
    numRef.WizardAllowChangeDown   = NoYes::No;
    numRef.WizardAllowChangeUp     = NoYes::No;
    numRef.GroupEnabled            = NoYes::Yes;
    numRef.SortField               = 7;
    numRef.ConfigurationKeyId      = configurationkeynum(ProjBasicOnAcc);

    this.create(numRef);

    numRef.DataTypeId              = typeId2ExtendedTypeId(typeid(ProjNormalCreditNoteId));
    numRef.ReferenceHelp           = literalstr("@SYS53897");
    numRef.ReferenceLabel          = literalstr("@SYS8125");
    numRef.WizardContinuous        = true;
    numRef.WizardManual            = NoYes::No;
    numRef.WizardAllowChangeDown   = NoYes::No;
    numRef.WizardAllowChangeUp     = NoYes::No;
    numRef.GroupEnabled            = NoYes::Yes;
    numRef.SortField               = 9;

    this.create(numRef);

    numRef.DataTypeId              = typeId2ExtendedTypeId(typeid(ProjOnAccCreditNoteId));
    numRef.ReferenceHelp           = literalstr("@SYS53899");
    numRef.WizardContinuous        = true;
    numRef.WizardManual            = NoYes::No;
    numRef.WizardAllowChangeDown   = NoYes::No;
    numRef.WizardAllowChangeUp     = NoYes::No;
    numRef.GroupEnabled            = NoYes::Yes;
    numRef.SortField               = 11;
    numRef.ConfigurationKeyId      = configurationkeynum(ProjBasicOnAcc);

    this.create(numRef);

    numRef.DataTypeId              = typeId2ExtendedTypeId(typeid(ProjPeriodVoucher));
    numRef.ReferenceHelp           = literalstr("@SYS53904");
    numRef.WizardManual            = NoYes::No;
    numRef.WizardAllowChangeDown   = NoYes::No;
    numRef.WizardAllowChangeUp     = NoYes::No;
    numRef.WizardLowest            = 170000000;
    numRef.WizardHighest           = 179999999;
    numRef.SortField               = 3;

    this.create(numRef);

    numRef.DataTypeId              = typeId2ExtendedTypeId(typeid(ProjNormalInvoiceVoucher));
    numRef.ReferenceHelp           = literalstr("@SYS53907");
    numRef.WizardContinuous        = true;
    numRef.WizardManual            = NoYes::No;
    numRef.WizardAllowChangeDown   = NoYes::No;
    numRef.WizardAllowChangeUp     = NoYes::No;
    numRef.WizardLowest            = 180000000;
    numRef.WizardHighest           = 189999999;
    numRef.GroupEnabled            = NoYes::Yes;
    numRef.DataTypeSameAsId        = typeId2ExtendedTypeId(typeid(ProjNormalInvoiceId));
    if (TaxParameters::find().VatBookEnable == NoYes::Yes)
    {
        numRef.AllowSameAs          = true;
    }
    numRef.SortField               = 5;

    this.create(numRef);

    numRef.DataTypeId              = typeId2ExtendedTypeId(typeid(ProjOnAccInvoiceVoucher));
    numRef.ReferenceHelp           = literalstr("@SYS53908");
    numRef.WizardContinuous        = true;
    numRef.WizardManual            = NoYes::No;
    numRef.WizardAllowChangeDown   = NoYes::No;
    numRef.WizardAllowChangeUp     = NoYes::No;
    numRef.WizardLowest            = 190000000;
    numRef.WizardHighest           = 199999999;
    numRef.GroupEnabled            = NoYes::Yes;
    numRef.DataTypeSameAsId        = typeId2ExtendedTypeId(typeid(ProjOnAccInvoiceId));
    if (TaxParameters::find().VatBookEnable == NoYes::Yes)
    {
        numRef.AllowSameAs          = true;
    }
    numRef.SortField               = 8;
    numRef.ConfigurationKeyId      = configurationkeynum(ProjBasicOnAcc);

    this.create(numRef);

    numRef.DataTypeId              = typeId2ExtendedTypeId(typeid(ProjNormalCreditNoteVoucher));
    numRef.ReferenceHelp           = literalstr("@SYS53909");
    numRef.WizardContinuous        = true;
    numRef.WizardManual            = NoYes::No;
    numRef.WizardAllowChangeDown   = NoYes::No;
    numRef.WizardAllowChangeUp     = NoYes::No;
    numRef.WizardLowest            = 200000000;
    numRef.WizardHighest           = 209999999;
    numRef.GroupEnabled            = NoYes::Yes;
    numRef.DataTypeSameAsId        = typeId2ExtendedTypeId(typeid(ProjNormalCreditNoteId));
    if (TaxParameters::find().VatBookEnable == NoYes::Yes)
    {
        numRef.AllowSameAs          = true;
    }
    numRef.SortField               = 10;

    this.create(numRef);

    numRef.DataTypeId              = typeId2ExtendedTypeId(typeid(ProjOnAccCreditNoteVoucher));
    numRef.ReferenceHelp           = literalstr("@SYS53910");
    numRef.WizardContinuous        = true;
    numRef.WizardManual            = NoYes::No;
    numRef.WizardAllowChangeDown   = NoYes::No;
    numRef.WizardAllowChangeUp     = NoYes::No;
    numRef.WizardLowest            = 210000000;
    numRef.WizardHighest           = 219999999;
    numRef.GroupEnabled            = NoYes::Yes;
    numRef.DataTypeSameAsId        = typeId2ExtendedTypeId(typeid(ProjOnAccCreditNoteId));
    if (TaxParameters::find().VatBookEnable == NoYes::Yes)
    {
        numRef.AllowSameAs          = true;
    }
    numRef.SortField               = 12;
    numRef.ConfigurationKeyId      = configurationkeynum(ProjBasicOnAcc);

    this.create(numRef);

    numRef.DataTypeId              = typeId2ExtendedTypeId(typeid(ProjJournalId));
    numRef.ReferenceHelp           = literalstr("@SYS53900");
    numRef.WizardManual            = NoYes::No;
    numRef.WizardAllowChangeDown   = NoYes::No;
    numRef.WizardAllowChangeUp     = NoYes::No;
    numRef.WizardHighest           = 999999;
    numRef.SortField               = 13;

    this.create(numRef);

    numRef.DataTypeId              = typeId2ExtendedTypeId(typeid(ProjTransIdBase));
    numRef.ReferenceHelp           = literalstr("@SYS53906");
    numRef.WizardFetchAheadQty     = 10;
    numRef.WizardManual            = NoYes::No;
    numRef.WizardAllowChangeDown   = NoYes::No;
    numRef.WizardAllowChangeUp     = NoYes::No;
    numRef.SortField               = 14;

    this.create(numRef);

    numRef.DataTypeId              = typeId2ExtendedTypeId(typeid(ProjAdjustmentId));
    numRef.ReferenceHelp           = literalstr("@SYS55535");
    numRef.WizardManual            = NoYes::No;
    numRef.WizardAllowChangeDown   = NoYes::No;
    numRef.WizardAllowChangeUp     = NoYes::No;
    numRef.WizardLowest            = 1;
    numRef.WizardHighest           = 999999;
    numRef.SortField               = 15;

    this.create(numRef);
    // Material Issue Request

    numRef.DataTypeId              = typeId2ExtendedTypeId(typeid(MaterialIssueId));
    numRef.ReferenceHelp           = literalstr("@AUR28");
    numRef.WizardManual            = NoYes::No;
    numRef.WizardAllowChangeDown   = NoYes::No;
    numRef.WizardAllowChangeUp     = NoYes::No;
    numRef.WizardHighest           = 999999;
    numRef.SortField               = 16;

    this.create(numRef);

    numRef.DataTypeId              = typeId2ExtendedTypeId(typeid(MaterialIssueLineID));
    numRef.ReferenceHelp           = literalstr("@AUR29");
    numRef.WizardManual            = NoYes::No;
    numRef.WizardAllowChangeDown   = NoYes::No;
    numRef.WizardAllowChangeUp     = NoYes::No;
    numRef.WizardHighest           = 999999;
    numRef.SortField               = 17;

    this.create(numRef);
    //Indent and Quotation
    numRef.DataTypeId              = typeId2ExtendedTypeId(typeid(IndentId));
    numRef.ReferenceHelp           = literalstr("Indent");
    numRef.WizardManual            = NoYes::No;
    numRef.WizardAllowChangeDown   = NoYes::No;
    numRef.WizardAllowChangeUp     = NoYes::No;
    numRef.WizardHighest           = 999999;
    numRef.SortField               = 16;

    this.create(numRef);

    numRef.DataTypeId              = typeId2ExtendedTypeId(typeid(PurchQuotID));
    numRef.ReferenceHelp           = literalstr("Quotation");
    numRef.WizardManual            = NoYes::No;
    numRef.WizardAllowChangeDown   = NoYes::No;
    numRef.WizardAllowChangeUp     = NoYes::No;
    numRef.WizardHighest           = 999999;
    numRef.SortField               = 17;

    this.create(numRef);

     numRef.DataTypeId              = typeId2ExtendedTypeId(typeid(RequestForIndentID));
    numRef.ReferenceHelp           = literalstr("Request For Quotation");
    numRef.WizardManual            = NoYes::No;
    numRef.WizardAllowChangeDown   = NoYes::No;
    numRef.WizardAllowChangeUp     = NoYes::No;
    numRef.WizardHighest           = 999999;
    numRef.SortField               = 18;

    this.create(numRef);

}

public static NumberSeqModule numberSeqModule()
{
    return NumberSeqModule::Proj;
}

No comments:

How to identify the user that was used to change an object from AOT in AX2012

Get the object name for which we need to track these (user and date&time) information's. Login to SQL Server Management Studio an...