[Form]
public class DAX_VendTrans extends FormRun
{
DAX_VendTable daxVendTabl;
VendTrans VendTrans;
str vendid;
QueryBuildDataSource vendtransdatasource;
/// <summary>
///
/// </summary>
public void init()
{
super();
daxVendTabl.doInsert();
insert_recordset daxVendTabl (DAX_Id,DAX_Amount,DAX_Date)
select AccountNum,AmountCur,TransDate from vendtrans;
DAX_VendTable.linkPhysicalTableInstance(daxVendTabl);
}
[DataSource]
class DAX_VendTable
{
/// <summary>
///
/// </summary>
public void executeQuery()
{
super();
str daxid = DAX_CustAccount.valueStr();
TransDate fromdate = DAX_FromDate.dateValue();
TransDate todate = DAX_ToDate.dateValue();
vendtransdatasource = this.query().dataSourceTable(tableNum(DAX_VendTable));
vendtransdatasource.addRange(fieldNum(DAX_VendTable,DAX_Id)).value(daxid);
vendtransdatasource.addRange(fieldNum(DAX_VendTable,DAX_Date)).value(SysQuery::range(DAX_FromDate.dateValue(),DAX_ToDate.dateValue()));
}
}
[Control("String")]
class DAX_CustAccount
{
/// <summary>
///
/// </summary>
/// <returns></returns>
public boolean modified()
{
boolean ret;
ret = super();
vendid = DAX_CustAccount.valueStr();
return ret;
}
}
[Control("CheckBox")]
class DAX_CheckBox
{
/// <summary>
///
/// </summary>
/// <returns></returns>
public boolean modified()
{
boolean ret;
ret = super();
if(DAX_CheckBox.value() == NoYes::Yes)
{
dAX_CustGroup.visible(true);
}
if(DAX_CheckBox.value() == NoYes::No)
{
dAX_CustGroup.visible(false);
}
return ret;
}
}
[Control("Button")]
class Ok
{
/// <summary>
///
/// </summary>
public void clicked()
{
super();
DAX_VendTable_ds.executeQuery();
vendtransdatasource.addSelectionField(fieldNum(DAX_VendTable,DAX_Amount ), SelectionField::Sum);
vendtransdatasource.orderMode(OrderMode::GroupBy);
vendtransdatasource.addGroupByField(fieldnum(DAX_VendTable, DAX_Id));
}
}
}
No comments:
Post a Comment