MRV+1 year

i am using nav 2004

my client want a report in which they want a re-test date , and there is no field named re-test and they don’t want that field.
they said

RE-TEST = DATE OF recieving + 1 year

NOW , we get re-test date
but they want a report in which only that items should be print whose

re-test date >= ‘today’ and re-test date < ‘today +15’

kindly help and mail me the coding

they want these field in report which i will print

  1. items name and no.

  2. batch no.

  3. manufacturer

  4. retest date

For computing the re-test date and the today+15 date, take a look at the documentation on the CALCDATE function. Once you’ve computed these two values, you can compare them to determine whether to include the current record in the report. You’ll probably want to use the CurrReport.SKIP command if the dates don’t compare favorably.

You’ll probably want to write the code that determines the today+15 value somewhere in the OnPreReport trigger. It’s a value that will remain constant throughout the entire report run (unless you need to allow for the possibility that the report could run across multiple days)

To compute the re-test date, you’ll want to write code in the OnAfterGetRecord trigger on the dataitem to which the re-test date applies. Since you’re constrained from adding a field to that table to record this value, you’ll have to compute it at runtime.

can you please write the CODEs

I USED THESE CODING… BUT NOW I WANT ITEMS WHOSE RE-TEST (DATE1) FALL BETWEEN 15 DAYS FROM TODAY

“REC-PBOMLINE”.RESET;

“REC-PBOMLINE”.SETRANGE(“No.”,“Lot No. Information”.“Item No.”);

IF FIND(’-’) THEN BEGIN

DATE1 := “REC-PRH”.“Posting Date”;

IF “REC-PBOMLINE”.Ingredients=“REC-PBOMLINE”.Ingredients::Active THEN

DATE1 :=CALCDATE( ‘1Y’)

ELSE

DATE1 := CALCDATE(‘2Y’ );

END;

Hi Yrana92,

The primary purpose of this site is educational, so I’ll happily try to guide you through the learning process. The site isn’t typically a good source of free labor (it may well frequently be a source of free labor, free code, but I can not say that I would call all of that good.)

So, for the first step, let’s take another look at the documentation for the CALCDATE function. What value does the command CALCDATE(‘1Y’) yield? What date value does the command operate on? What value do you need it to operate on?

And then, of course, is the obligatory reference to NAV coding guidelines and standards, specifically as related to variable naming conventions. You’ll find ample material on the subject here and in the documentation included with the NAV installation media.