Developer forum

Forum » Dynamicweb 10 » Create new Numbers in EcomNumbers

Create new Numbers in EcomNumbers

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,
I need to create new records inside the EcomNumbers table.
I would like to create them when/after installing an App. How can I do it properly? I see that I can create a New Number, but I have some issues getting the proper NumberId set.
I see that the ID property is a string, while the table properties say it's an int set as identity with seed.
What is the correct way?

Thank you,
Adrian


Replies

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply

Hi Adrian,

The NumberId column just represents the id of the number, there's no magic. It's not an identity, in fact it doesn't even have to be a numeric value. You can put anything you want as long as it's unique. The important columns are 

  • NumberType
    Used to fetch a number using NumberGenerator.GetNumber(TYPE)
  • NumberPrefix
    Prepended to the counter, e.g., ORDERXXX
  • NumberCounter
    The current counter for the number, usually 0 when the row is inserted
  • NumberAdd
    The increment to add to the counter for each new number generated, usually 1

I hope that clears up some of the magic behind the EcomNumbers table.

- Jeppe

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Jeppe,
Thank you very much for the fast response.
Understood! That's how I did it so far, I was worried I may break something :)

Thank you,
Adrian

 

You must be logged in to post in the forum