The trouble is you think you have time. Your success depends on how you utilize your time.

DP Class for UI Builder ListEnumerator d365 x++ Finance and Operations

 DP Class for UI Builder ListEnumerator d365 x++ Finance and Operations


[SRSReportQueryAttribute(querystr(_YourQuery)),
SRSReportParameterAttribute(classStr(YourContract))]
class _YourQueryInquiryDP extends SRSReportDataProviderBase
{
  _YourQueryTmp tempTable;
  ListEnumerator custlistiterator;
  [SRSReportDataSetAttribute(tableStr(_YourQueryTmp))]
  public _YourQueryTmp get_YourQueryTmp()
  {
    select * from tempTable;
    return tempTable;
  }
  private Query buildQuery( Query _query, List Categorylist, FromDate _fromDate,ToDate _toDate)
  {
    _query.dataSourceTable(tableNum(CaseDetailBase)).addRange(fieldNum(CaseDetailBase, ClosedDateTime)).value(queryRange(_fromDate, _toDate));
    custlistiterator = CategoryList.getEnumerator();
    while(custlistiterator.moveNext())
    {
      currentrec = custlistiterator.current();
      _query.dataSourceTable(tableNum(CaseDetailBase)).addRange(fieldNum(CaseDetailBase, YourField)).value(currentrec);
    }
    return _query;
  }
  private void insert()
  {
    FromDate       fromDate;
    ToDate         toDate;
    QueryRun       queryRun;
    List           CategoryList;
    
    YourContract contract = this.parmDataContract();
    if(contract)
    {
      fromDate = contract.parmFromDate();
      toDate   = contract.parmToDate();
      CategoryList = contract.parmCategoryName();
    }    
    queryRun = new QueryRun(this.buildQuery(this.parmQuery(),CategoryList, fromDate, toDate));
    while (queryRun.next())
    {
      caseDetailBase = queryRun.get(tableNum(CaseDetailBase));      
      tempTable.clear();
      tempTable.CompanyLogo = FormLetter::companyLogo();
      tempTable.Column1 = 'www.Moznum.com';
      tempTable.Column2 = 'www.Moznum.Blogspot.com';
      tempTable.insert();  
    }
  }
  [SysEntryPointAttribute(false)]
  public void processReport()
  {
    delete_from tempTable;
    this.insert();
  }
}

No comments:

Post a Comment