IPeople Blog

Using the BFI Field Attribute on NPR Report Writer Screens (MAGIC and C/S)

Written by Gary | Mar 28, 2022 5:00:00 AM

BFI stands for Before Input.  BFI attributes can come in pairs, just like FCL attributes.  They perform checks after the IFE attribute has resulted in a non-nill value and after the DFT2 attribute has been set up, but before the end-user has entered in anything. 

In this example, assume your report has a Select Field called 'date' that accepts a range of dates using the GE and LE operators.  The beginning date for the GE operator is stored in b.date, and the ending date for the LE operator is stored in e.date.  Assume the end-user enters in the dates incorrectly: b.date is after e.date.  If your report has another Select Field that comes after the 'date' Select Field, you can use a BFI attribute on the third Select Field to check for the incorrect dates and then redisplay them correctly:

  1. For your report, you will need to set up a macro called 'check' with the following code:
    b.date^TEMP,
    e.date^b.date,
    TEMP^e.date,
    @Display(b.date),
    @Display(e.date),
    "";
  2. Your BFI attributes should appear like this.  You will need to replace DPM with your Report DPM and report with the name of your report:
    BFI1=b.date>e.date
    BFI1A=%DPM.zcus.report.M.check("")

Please NOTE: @Display is an NPR programming Macro that displays a value for a field in the position of the field at the time the NPR Report Macro is translated.  If your field is moved around on your screen, you will need to retranslate this macro so that the @Display programming Macro displays the value at the new position.