Get your numbers in sequence with NumberSequence in AL and Business Central

Поділитися
Вставка

КОМЕНТАРІ • 5

  • @RichardGomez-r6g
    @RichardGomez-r6g 3 місяці тому +1

    Great video as always senor Erik, you are the godfather of BC

  • @jonwlong
    @jonwlong 3 місяці тому +2

    So, I tested (using the test framework) creating an incremented integer using an AutoIncrement=True field vs NumberSequence. 10,000 iterations took:
    AutoIncrement Field = 3.6 seconds
    NumberSequence = 10 milliseconds
    (Yes, these are burned in, meaning I ran it a few times)
    Also interesting is, the following test produces 1 everytime, within the test framework, UNTIL, you run the same manually in the client. Then, even in test, it increases by 1. So, the test framework rolls back the NumberSequence, as you would expect, since it's a record. This is different than the AutoIncrement, which increases by 1 regardless of running in TEST or not. But, the test framework only rolls back if the NumberSequence doesn't already exist outside of the test framework.
    [TEST]
    procedure Test_NumberSequence()
    var
    begin
    if not NumberSequence.Exists('testns') then
    NumberSequence.Insert('testns', 1, 1);
    Error(Format(NumberSequence.Next('testns')));
    end;
    trigger OnOpenPage()
    begin
    if not NumberSequence.Exists('testns') then
    NumberSequence.Insert('testns', 1, 1);
    Error(Format(NumberSequence.Next('testns')));
    end;

    •  3 місяці тому

      And what happend with locks? Does NumberSequuence lock a lot?

  • @LarsLohndorf-Larsen
    @LarsLohndorf-Larsen 3 місяці тому +1

    Thanks for another great video. Maybe you can do something around the new sales pricing, posting routine (posting buffer) and other good app-developer stuff, just a few ideas if you are bored 😀. Interesting mix we have now of .al commands (NumberSequence) and data (Number Series). Good point about the naming - every time I create a variable starting with "Noser" I think of my face. Especially good point since there is no "No" in Number...

  •  3 місяці тому

    Very useful.
    I don't like Autoincremented fields, I use guid fields to get a unique key, but with this way, you can control the value of the field.
    Thank you Erik.
    Could you, please, make a video about signing xml files. With codeunit SignedXML i.e.?
    Thank you again, and plese, keep doing this useful videos