Skip to main content
Answer

Add Numbering Sequence to Customization Project

  • October 31, 2024
  • 3 replies
  • 124 views

I have added a Numbering Sequence to my changes, but I cant see how to put this in my Customization Project to have everything deployed together to other instances. Am I missing something or do I need to do it in SQL. Any suggestions please.

Best answer by MichaelShirk

@chriserlebach34 

Here’s how you can accomplish that. 

  1. Create a custom class derived from the “CustomizationPlugin” class.
  2. Override the “OnPublished” event with an empty method.
  3. Override the “UpdateDatabase()” method and add your custom code to set up the numbering sequence programmatically, (Making sure to first check that it doesn’t exist already.)

Here’s the example.
 

//Class derived from CustomizationPlugin    
public class YourSetupPlugin : CustomizationPlugin
{
public override void OnPublished()
{
//Leave Empty
}

public override void UpdateDatabase()
{
//Your custom code to create and assign the numbering sequence if not already set up.
}
}

Note: I don’t really think the empty “OnPublished()” override is required, but this is how it’s set up in our solution and I know this works.

Here is another article on the subject.
Acumatica's Customization Plugin | Acumatica Cloud ERP

3 replies

DipakNilkanth
Pro III
Forum|alt.badge.img+13

Hi @chriserlebach34,

How do you create a numbering sequence?

If you created the numbering sequence from the Numbering Sequences (CS201010) screen, I believe, you will need to create the same sequence on any instance where you plan to publish the customization package.

If the numbering sequence was added by code, it will be automatically applied after publishing the customization.

Hope, it helps!


MichaelShirk
Captain II
Forum|alt.badge.img+5
  • Captain II
  • Answer
  • October 31, 2024

@chriserlebach34 

Here’s how you can accomplish that. 

  1. Create a custom class derived from the “CustomizationPlugin” class.
  2. Override the “OnPublished” event with an empty method.
  3. Override the “UpdateDatabase()” method and add your custom code to set up the numbering sequence programmatically, (Making sure to first check that it doesn’t exist already.)

Here’s the example.
 

//Class derived from CustomizationPlugin    
public class YourSetupPlugin : CustomizationPlugin
{
public override void OnPublished()
{
//Leave Empty
}

public override void UpdateDatabase()
{
//Your custom code to create and assign the numbering sequence if not already set up.
}
}

Note: I don’t really think the empty “OnPublished()” override is required, but this is how it’s set up in our solution and I know this works.

Here is another article on the subject.
Acumatica's Customization Plugin | Acumatica Cloud ERP


  • Freshman III
  • November 1, 2024

I second @MichaelShirk 

I’ve used this method to add many different types of data with my customizations.

Just note that the UpdateDatabase() code will run every time the customization package is published, so always check that the update needs to be applied first.