วันพฤหัสบดีที่ 7 มีนาคม พ.ศ. 2556

Passing_values_between_forms

Credit  http://www.axaptapedia.com/index.php?title=Passing_values_between_forms

override fetch() in report



// Class Declaration
public class ReportRun extends ObjectRun
{
  A  AP;
}

// set current record

public void init()
{
    super();

    AP = element.args().record();

}

// change datasorce in fetch() method and ranged by  field on current record


public boolean fetch()
{
    QueryRun qr;
    QueryBuildRange rangeJobNumber;
    boolean ret;
    A   _A;
    ;

    qr = new QueryRun(element);
    rangeJobNumber =
    element.query().dataSourceTable(tablenum(A)).addRange(fieldnum(A,A1));
    rangeJobNumber.value(AP.A1);
    rangeJobNumber.status(RangeStatus::Locked);

 if(qr.prompt() && element.prompt())
  {
    // element.send(A_1,1);
     while (qr.next())
     {
          _A= qr.get(TableNum(A));
          element.send(_A);
     }
  }

   ret = true;
   return ret;
}