class CustCreateDialog extends RunBase
{
DialogField fieldAccount;
DialogFIeld fieldGroup;
CustTable custTable;
CustTrans custTrans;
CustAccount custAccount;
CustGroupId custGroup;
}
--------------------------------------------------------------------------------------------------------------------------
protected Object Dialog()
{
Dialog dialog;
;
dialog = super();
// Set a title for dialog
dialog.caption( 'Simple Dialog');
// Add a new field to Dialog
fieldGroup = dialog.addField(extendedTypeStr(CustGroupId), 'Customer Group');
fieldAccount = dialog.addField(extendedTypeStr(CustAccount),'Customer account');
return dialog;
}
-------------------------------------------------------------------------------------------------------------------------
public boolean getFromDialog()
{
// Retrieve values from Dialog
custAccount = fieldAccount.value();
custGroup = fieldGroup.value();
return super();
}
-------------------------------------------------------------------------------------------------------------------------
public void run()
{
while select AccountNum, CustGroup from custTable
where custTable.AccountNum == custAccount
&& custTable.CustGroup == custGroup
join Voucher, AmountCur, TransDate from custTrans
where custTrans.AccountNum == custTable.AccountNum
if (custTable)
{
// Shows retrieved information
info( strFmt('%1 -- %2 -- %3 --- %4 ---%5' , custTable.AccountNum, custTable.name(), custTrans.Voucher, custTrans.AmountCur, custTrans.TransDate));
}
else
{
error( 'Customer Account not found!');
}
}
--------------------------------------------------------------------------------------------------------------------------
public static void main(Args _args)
{
CustCreateDialog custCreate = new CustCreateDialog();
// Prompt the dialog, if user clicks in OK it returns true
if (custCreate.prompt())
{
custCreate.run();
}
}
{
DialogField fieldAccount;
DialogFIeld fieldGroup;
CustTable custTable;
CustTrans custTrans;
CustAccount custAccount;
CustGroupId custGroup;
}
--------------------------------------------------------------------------------------------------------------------------
protected Object Dialog()
{
Dialog dialog;
;
dialog = super();
// Set a title for dialog
dialog.caption( 'Simple Dialog');
// Add a new field to Dialog
fieldGroup = dialog.addField(extendedTypeStr(CustGroupId), 'Customer Group');
fieldAccount = dialog.addField(extendedTypeStr(CustAccount),'Customer account');
return dialog;
}
-------------------------------------------------------------------------------------------------------------------------
public boolean getFromDialog()
{
// Retrieve values from Dialog
custAccount = fieldAccount.value();
custGroup = fieldGroup.value();
return super();
}
-------------------------------------------------------------------------------------------------------------------------
public void run()
{
while select AccountNum, CustGroup from custTable
where custTable.AccountNum == custAccount
&& custTable.CustGroup == custGroup
join Voucher, AmountCur, TransDate from custTrans
where custTrans.AccountNum == custTable.AccountNum
if (custTable)
{
// Shows retrieved information
info( strFmt('%1 -- %2 -- %3 --- %4 ---%5' , custTable.AccountNum, custTable.name(), custTrans.Voucher, custTrans.AmountCur, custTrans.TransDate));
}
else
{
error( 'Customer Account not found!');
}
}
--------------------------------------------------------------------------------------------------------------------------
public static void main(Args _args)
{
CustCreateDialog custCreate = new CustCreateDialog();
// Prompt the dialog, if user clicks in OK it returns true
if (custCreate.prompt())
{
custCreate.run();
}
}
Thanks for sharing this.,
ReplyDeleteLeanpitch provides online training in Scrum Master during this lockdown period everyone can use it wisely.
Join Leanpitch 2 Days CSM Certification Workshop in different cities.
CSM training online
you have provide code ,i am new please share step by step processes of dialog from
ReplyDelete