I'm attempting to build onto a previous post where an info log was generated that provided voucher information.
I'm creating a class to present to the user a dialog box with a pick list of customer accounts. When compiling the run method I'm receiving a syntax error. Below is the class I started to create.
First the classDeclaration
class CyborgDialogInput extends RunBase
//this is the class declaration
{
CustTable custTable;
CustTrans custTrans, countCustTrans; //why is the table buffer created twice?
DialogField fieldAccount;
DialogField fieldName;
SysOperationProgress sysOperationProgress;
int vCount,crow;
CustAccount varCustAccount, custAccount;
str strLongRes;
}
Next the Dialog Method
protected Object Dialog()
{
Dialog dialog;
;
dialog = super();//what does this method do?
//Sets the title for the dialog
dialog.caption( 'Cust Voucher Info');
//creates the dialog field
fieldAccount = dialog.addField(extendedTypeStr(CustAccount), 'Customer Account');
return dialog;
}
The get method
public boolean getFromDialog()
{
//This method is used to capture the selected value
//from the Dialog method
custAccount = fieldAccount.value();
return super();
}
The run method where I encounter the compile error which just states Syntax error.
The compiler highlights a portion of the line starting with sysOperationProgress
public void run()
{
custTable = custTable::find(custAccount);
//Below is where I encounter the error
sysOperationProgress Progress = new SysOperationProgress(); --complier highlights from Progress to the end of the line.
#AviFiles
varCustAccount = custAccount;
select count(RecId) from countCustTrans
where countCustTrans.AccountNum == varCustAccount
&& countCustTrans.Voucher != '';
vCount = int642int(countCustTrans.RecId);
setPrefix(strFmt('Total Count %1',vCount));
crow=1;
progress.setCaption(strFmt("Processing %1 records",vCount));
progress.setAnimation(#AviUpdate);
progress.setTotal(vCount);
while select AccountNum from custTable
join custTrans
where(custTrans.AccountNum == custTable.AccountNum)
&& custTable.AccountNum == varCustAccount
{
//sets the variable strLongRes and reduces typing
strLongRes = int2str(crow)+" "+custTable.AccountNum+ "-"+ custTrans.Voucher+"-"+date2str(custTrans.TransDate,213,DateDay::Digits2,DateSeparator::Auto,DateMonth::Digits2,DateSeparator::Auto,DateYear::Digits4);
//info method to communicate output of strLongRes
info(strLongRes);
//this is calling the class methods of progress to display to the user
//after running this multiple times it executes faster but I saw it the first run
progress.setText(strfmt("Exeuting %1 for total of %2", crow,vCount));
Progress.incCount();
//increment the variable crow for communication on progress to the user
crow = crow+1;
}
}
There are most likely a few other issues with this code and the concept I'm working to understand but there is a simple concept I'm missing. Any help would be appreciated as I take yet another baby step.
Thank you in advance.