Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tor Langlo 190 posts 533 karma points
    Feb 22, 2023 @ 23:16
    Tor Langlo
    0

    Implementing a sequential order number generator

    Is there any sample code out there implementing a sequential order number generator? I'm particularly looking for code which could create a custom table on demand and then load and save a single record.

    I guess this question could also be "how to do custom database access from Vendr".

    Disclaimer, I have read https://our.umbraco.com/packages/website-utilities/vendr/vendr-support/102060-changing-order-number-format and understand this.

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Feb 23, 2023 @ 08:55
    Matt Brailsford
    100

    Hi Tor,

    I don't have any specific code, but you could use Umbraco migrations to setup the database table (maybe take a look at https://docs.umbraco.com/umbraco-cms/extending/database)

    I think for the DB lookups, I might be tempted to run raw SQL commands to keep things as fast as possible, but if you know the site won't be under a lot of preasure, you could use NPoco for that too.

    Hope this helps a little

  • Tor Langlo 190 posts 533 karma points
    Feb 23, 2023 @ 21:21
    Tor Langlo
    0

    Thanks Matt!

    I have implemented a sequential order number generator using code in the link you gave me. This will serve our purpose for the time being (migrating from TeaCommerce). Maybe one day we will have enough business for this generator to become a performance bottleneck, and will then review and maybe revert to Vendr's built in solution :-)

Please Sign in or register to post replies

Write your reply to:

Draft