Friday 8 August 2014

DISPLAY CURRENT MONTH TRANSACTIONS FOR A PARTICULAR CUSTOMER


We have to follow some steps:

Step1:
Create a table Name as CustTransForm with fields CustAccount ,TransactionDate.


Step 2:

Add the Table As a Datasource into the Form.(CustTransForm)


Step 3:

Add CustTransForm into MenuItem-->Display, in AOT.

Step 4:

Add a MenuItemButton in ActionPane of the CustTableListpage form, for Calling the CustTransForm, by setting the MenuItemButton's property MenuItemName :CustTransForm.

Step 5:

Now we need to display the Current Month Transactions in the CustTransForm whenever it is called from CustTableListPage form.

For this we can write init() method and one User-defined method(TransMethod()):-



Step 6:

Write Code for Init() method in Form(CustTransForm) level:

public void init()

{

super();

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

CustTransForm.setTmpData(element.TransMethod());

CustTransForm_ds.executeQuery();

}

Step 7:

Write Code for TransMethod() in Form(CustTransForm) level:

CustTransForm TransMethod()

{

int startDate=mthOfYr(today());

while select custTrans

where custtrans.AccountNum==custTable.AccountNum

{

if(mthOfYr(custTrans.TransDate)==startDate)

{

custTransForm1.CustomerAccount=custTable.AccountNum;

custTransForm1.TransactionDate=custTrans.TransDate;

custTransForm1.insert();

}

}

return custTransForm1;

}

Step 8:

Now we get the output:-
 
 

No comments:

Post a Comment