Passing Code Variable

I feel ashamed to ask this, but its been a while since I have had to do this, and cannot seem to remember. On a menu button, I am running a form, and I would like to fill the contents of the customer code field on this form with the customer code from “REC”. Many Thanks in advance

I would be happy to help you but, I don’t quite understand what you are trying to do. Do you mean you are lauching a form from a menu button? Is the new form “attached” to the customer table? Give more information and I’ll try to help. Bill Benefiel Manager of Information Systems Overhead Door Company billb@ohdindy.com (317) 842-7444 ext 117

I had a little help, and this was the outcome. On Push() CLEAR(EnqHeader); EnqHeader.“Customer Code”:=Rec.“No.”; EnqHeader.VALIDATE(EnqHeader.“Customer Code”); EnqHeader.“Document Type”:=EnqHeader.“Document Type”::“Enquiry Quote”; EnqHeader.INSERT(TRUE); FORM.RUN(FORM::“Enquiry Quote”,EnqHeader); Many Thanks anyway Bill!!

Humm… and how about using in the properties of the menu option something called RunFormLink ?? (you’ve an example if you want it at the customer’s card (form 21) button customer, option bank accounts. Regards from California… – Alfonso Pertierra apertierra@teleline.es Spain Western Computer Los Angeles, California

If only life was that simple !! That was the first thing that I tried, but as the form itself was doing various tasks, this made things worse, this is why I needed a work around. On a similar thread, Is it possible to directly pass REC to a report print, or do I have to create a function like so many of the other navision reports in the system ??

You can pass a filter to a report. Try recVariable := Rec recVariable.SETRECFILTER REPORT.RUNMODAL(Report::YourReport,recVariable) You can use every filter you want, but only pass it to the first dataitem of the report.

On Push() CLEAR(EnqHeader); EnqHeader.“Customer Code”:=Rec.“No.”; EnqHeader.VALIDATE(EnqHeader.“Customer Code”); EnqHeader.“Document Type”:=EnqHeader.“Document Type”::“Enquiry Quote”; EnqHeader.INSERT(TRUE); enqheader.reset; enqheader.setfilter(“Customer Code,”,’%1’,Rec.“No.”); enqheader.setfilter(“Document Type”,’%1’,“Document Type”::“Enquiry Quote”); enqheader.find(’-’) FORM.RUN(FORM::“Enquiry Quote”,EnqHeader);

Oliver, It is possible to set filters on all dataitems, if you declare the report as a variable. MyReport.SETTABLEVIEW(Rec); MyReport.SETTABLEVIEW(AnotherRec); MyReport.RUNMODAL; Edited by - lennart nielsen on 2001 Aug 30 14:57:09