Functions of codings in the form 5709

Dear All,

I would like to ask you about this codings that I see in the form 5709 (not table) :
SetPurchHeader(VAR PurchHeader2 : Record “Purchase Header”)
PurchHeader.GET(PurchHeader2.“Document Type”,PurchHeader2.“No.”);
PurchHeader.TESTFIELD(“Document Type”,PurchHeader.“Document Type”::Invoice);

IsFirstDocLine() : Boolean
TempPurchRcptLine.RESET;
TempPurchRcptLine.COPYFILTERS(Rec);
TempPurchRcptLine.SETRANGE(“Document No.”,“Document No.”);
IF NOT TempPurchRcptLine.FIND(’-’) THEN BEGIN
PurchRcptLine.COPYFILTERS(Rec);
PurchRcptLine.SETRANGE(“Document No.”,“Document No.”);
PurchRcptLine.FIND(’-’);
TempPurchRcptLine := PurchRcptLine;
TempPurchRcptLine.INSERT;
END;
IF “Line No.” = TempPurchRcptLine.“Line No.” THEN
EXIT(TRUE);

I don’t understand their functions in the form, and especially the boolean datatype, could you please let me know their functions…? I would welcome for your answers.

Rgds,

Mark

If you look at what is shown on the form it will help you. Basically this is seeing if the receipt line has been selected before and providing a return of Yes or No.

IsFisrtLine is only used for formatting. It allows you to put the first line of the Order in Bold, or to not display the Dcouemtn numbers on the rest of the line. This gives a good visual break between where one order ends, and the next starts.

Hi,

Tks for your answer and also other’s answer (kdm’s answer). I actually have deleted the codings but then the get receipt lines can’t work, then I try to delete the commandbutton coding, the get receipt lines can’t also work. So, if I create new form like the 5709 form, and only use the commandbutton coding but skip the others can it work good then…?? I am interesting to its selecting function coding in the form, about how it works.

Rgds,

Mark Christs

The function is called from the Document No. OnFormat (click on document number in the form and presss F9). As mentioned if it is the first line the Documnet No is shown in bold else it is not shown. Removing the function should have no effect on the get receipt lines. What are you trying to do?

Why are you deleting the code?

yes, comment it out “//” if anything

Tks for answer.

Do you mean when I run form 5709 and then press F9 or when run form 145 then press F9 ??

I actually want to create new button and CU. The button and CU are related each other. I see that the function of them similar with form 5709, except the coding structures maybe different (record and form name and also its CU name). It’ using selectfilter, rec, CU, C/AL Global and Local.

Rgds,

I am trying to create new CU and the structure seems same with the coding inside the form (the coding I write) but I skip the other coding (non …onpush()) coding.

hey man, you are right, I forget to tell the reason but actually it’s not the important point to tell, top secret babe.

Anyway, you should put star of david instead of using std stars-it’s evil sign (check this site: www.morbidangel.com) in your avatar, but I don’t have right, I only give opinion

Rgds,

Mark