Use Current Record

oleschjoetholeschjoeth Member Posts: 74
edited 2004-05-17 in Navision Attain
Hello :D

I guess this is a simple question if one knows "how-to"! But in the very old Navision (3.56 DOS) there was a function called "GetCurrentRec" meaning get the current record for further processing.
On a form I have created a button calling a report. I want this report to pick up the current record from the form and perform some processing on the record and terminate with a print.

- how do I do that in Attain?

All help appriciated :D

Regards, Ole

Comments

  • sjansjan Member Posts: 16
    Use command

    REPORT.RUN("Report ID",ReqWindow,SystemPrinter,CurrentRecord) in Button.OnPush().

    ReqWindow and SystemPrinter are Boolean and means to show Request Window before printing and to tell whether you want to use Standard Printer or to choos from a list of available printers.
  • oleschjoetholeschjoeth Member Posts: 74
    ...for that you need a developers license which I unfortunately to do not have at this point. Wouldn't there be a way to pick up the current record from the report?

    Thanx :D
  • RobertMoRobertMo Member Posts: 484
    The report is not aware from which record was run unless using suggested solution.

    I see you are looking for properties that can be set when runing a form.

    You can make a new form based on same table (without any controls)and run it on your button instead of your report (set RunFormOnRec=Yes).

    I hope you can write code on your forms ? It should look like:
    OnOpenForm()
    CurrForm.VISIBLE(FALSE);
    Rec.SETRANGE("No.","No.");
    REPORT.RUNMODAL(55555,TRUE,TRUE,Rec);
    CurrForm.CLOSE;

    this trick actually runs your form (on which I assume you can write code) and in its code you are using previous solution. you never see the form itself...

    and you are using one form more... is it cheaper than ask your NSC to do this for you?
               ®obi           
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  • oleschjoetholeschjoeth Member Posts: 74
    Thank you RobertMo - it works :D
Sign In or Register to comment.