Line No

Hi experts,

I created a sales order. It has 3 sales lines. In sales line u have a field Line No .

Line No = 10000,

Line No = 20000,

Line No = 30000,……………… It is increasing automatically.

I checked sales order subform . It has the property Autosplit Key = Yes.

Even i searched sales line table. I could not get where it is assigned.

I could not get where it is assigned like Line No := 10000 at first for sales line & Purchase Line.

Please thorw some suggestions on this

Thanks and regards

You will not be able to find this functionality anywhere in the code, as this is done internally when you use the property Autosplit Key.

If you want to read more about this, then use the search function (keyword: Autosplit)

Also in online help of Navision search for AutoSplitKey.

Thanks Erik ,

How it is possible with assign . Why don’t it take 100 . Why it is taking at first 10000.

Even I checked sales –Post codeunit . In that u can find lot of times assign like this.

// Post VAT

LineNo := 10000;

IF VATPostingBuffer[1].FIND(’+’) THEN

REPEAT

WITH SalesHeader DO BEGIN

TestDeleteHeader(SalesHeader,SalesShptHeader,SalesInvHeader,SalesCrMemoHeader,ReturnRcptHeader);

IF SalesShptHeader.“No.” <> ‘’ THEN BEGIN

SalesShptHeader.INSERT;

SalesShptLine.INIT;

SalesShptLine.“Document No.” := SalesShptHeader.“No.”;

SalesShptLine.“Line No.” := 10000;

ReturnRcptLine.INIT;

ReturnRcptLine.“Document No.” := ReturnRcptHeader.“No.”;

ReturnRcptLine.“Line No.” := 10000;

SalesInvLine.INIT; SalesInvLine.“Document No.” := SalesInvHeader.“No.”;

SalesInvLine.“Line No.” := 10000;

Of course this assigned after u post . To insert in to sales invoice form ……………

Like this some where it is assigned for sales line what I think.

Please provide solutions.

thanks and regards

The reason for taking 10000 and not 100 is simply that if you insert a new line between ie. line one and two then there must be an empty line no. to use. If you have only 100, then the next line was 150 (if inserted between the two lines). And the next again 125 - then 112, then 106, then 103. As you see not a lot of options.

The code you show above is for creating the sales shipments, where the system does the same thing as the Autosplit Key function.

Thanks Erik,

I have written some examples from Sales -post code unit. In that codeunit u can observe the assign like this

Line := 10000,

Of course it is creating sales shipments , or some thing. what ever it may be . It has some assign.

with out assign how it takes automatically. Even i know about autosplit key property.

I hope like this sales line has some assign .

Could u give that place.

thanks and regards

I’m sorry I don’t understand your question. What do you mean by assign?

Maybe I should give the same answer a few times in different words, hoping that it will answer the same question that has been asked a few times. Something must be lost in translation.

There is no C/AL code anywhere that assigns the line number. This is done automatically by the internal code. The property called ‘Autosplitkey’ automatically assigns the line number, and it gives you enough room (in most cases) to insert lines in between. It does not execute any C/AL code.

There is no code that you can see the assignment. It is not in C/AL code. The code is not visible for us to see, it is internal in the executable of the form.

The code to assign the line number does not exist in a place that you can see it. It is part of the program, it is not programmed in C/AL code.

There is no place that there is an assignment in C/AL code. It exists, but not in C/AL, so we cannot see it.

I hope you understand now.

There is no assign. It is done by the form, not in some C/AL code statement

The posting routine is an example where it is programmed in C/AL. In that example it is programmed in C/AL, not by setting a property.

Setting it with the property makes it assign the number automatically, not by C/AL code.

I don’t know why they took 10000. It could have also been 20000, or 30000, or 5, or 657483957662551437869. Different numbers have different number of lines that you can insert. I guess they liked the number 10000 because it is an easy number. It’s just the way that it works, and you cannot change it.

You cannot change it because it is internally, not in C/AL. So you cannot see it, there is no place where you can read the code, because it is not programmed in C/AL.

Autpsplitkey is a property that is only available on forms. In any other type of object it has to be programmed. That is why in the sales posting routine it is programmed in C/AL, and on forms that have the property turned on it is done automatically.

Autosplitkey is not programmed in C/AL, it is part of the executable. There is no place that you can look at the assignment in C/AL because it is not there.

I guess you made your point Daniel! [;)] Just please remember, we have all been beginners at some point many years ago! [:)]

I think it is mostly a language issue. Hopefully, by saying it a few different ways, it will be clear. It’s frustrating enough not to be able to find something, and I really want them to understand the difference.

Thank u so much Erik.

Thank u So much Denster.

Both of u r explanations are wonderful. Really amezing

this query started because I did try to change the line number , through C/AL

. Now i understood that is not possible to change it after u r unmemorable explanation.

Thanks Guys one more time.

Both of u had given excellent explantions to this fresher.

It is Solved by Erik, Denster.

thanks and regards