Report with a filter to look in another table

Red-EagleRed-Eagle Member Posts: 107
I have a report on the table extension contract. I want to make an option field that you can say that you only want to see the jobs which are open.
The option field is no problem, but the job status field excist only in the table JOB. How can get the report look in the JOB table and give me only all JOBS which are open.

This is what i made till now:


IF PrintProjectstatusBln = TRUE THEN (the option button)

CLEAR(Projectrec);
Projectrec.GET("Extension Contract"."Project No.");
Projectrec.SETFILTER("No.","Extension Contract"."Project No.");
Projectrec.SETFILTER("Project Status",'<Gereed Gemeld');

Comments

  • geordiegeordie Member Posts: 655
    Insert code like this in OnAfterGetRecord trigger of table extension contract.
    IF ShowOnlyOpenJob THEN BEGIN
      Job.GET(ExtContract."Job No.");
      Job.Status <> Job.Status::Open THEN
        CurrReport.SKIP;
    END;
    

    Please note that since I don't know that table I'm not sure about the link with Job table.
  • Red-EagleRed-Eagle Member Posts: 107
    Geordie thank you for you input.

    I dont see how it work:

    The code i have now is:

    IF PrintProjectstatusBln = TRUE THEN BEGIN

    CLEAR(Projectrec);
    Projectrec.GET("Extension Contract"."Project No.");
    Projectrec.SETFILTER("No.","Extension Contract"."Project No.");
    Projectrec.SETFILTER("Project Status", 'CALCULATIE|VOORBEREIDING|UITVOERING|TECHNISCH GEREED| ADMINISTRATIEF GEREED');
    END;

    I have no errors on the code, so the links are good, but i dont think the program understand that before he shows the job (project) it has to look at the status of the job in the table job.
Sign In or Register to comment.