Display and Edit methods Examples:
First Create 3 methods in CustTable as following:
1)
display CustBankAccountId displaybankgroup() // to display bankaccountid
{
CustBankAccount custBankAccount;
BankGroup bankGroup;
// BankAccountTable bankAccountTable;
;
/* select accountid from custBankAccount
where custBankAccount.CustAccount==this.AccountNum ;
return custBankAccount.AccountID;
*/
return CustTable::find(this.AccountNum).BankAccount;
}
2)
display Name displayname() // to display name
{
DirPartyTable dirPartyTable;
CustTrans custtrans;
Name name;
;
name = CustTable::find(this.AccountNum).name();
//info(name);
/*select Name from dirPartyTable
where dirPartyTable.RecId==this.Party;
return dirPartyTable.Name;
*/
return CustTable::find(this.AccountNum).name();
}
3)
public edit Name editname(
boolean _set,
CustTable _CustTable,
Name _name
) // To display name and also we can the Edit name
{
DirPartyTable dirpartytable;
if (_set)
{
ttsBegin;
dirpartytable = DirPartyTable::findRec(CustTable::find(this.AccountNum).Party,true);
dirpartytable.Name = _name;
dirpartytable.update();
ttsCommit;
}
return _CustTable.name();
}
N ow Create a new Form like below:
Add the fields like above in grid set datasource as custtable and fill the datamethod property of all fields respectively
First Create 3 methods in CustTable as following:
1)
display CustBankAccountId displaybankgroup() // to display bankaccountid
{
CustBankAccount custBankAccount;
BankGroup bankGroup;
// BankAccountTable bankAccountTable;
;
/* select accountid from custBankAccount
where custBankAccount.CustAccount==this.AccountNum ;
return custBankAccount.AccountID;
*/
return CustTable::find(this.AccountNum).BankAccount;
}
2)
display Name displayname() // to display name
{
DirPartyTable dirPartyTable;
CustTrans custtrans;
Name name;
;
name = CustTable::find(this.AccountNum).name();
//info(name);
/*select Name from dirPartyTable
where dirPartyTable.RecId==this.Party;
return dirPartyTable.Name;
*/
return CustTable::find(this.AccountNum).name();
}
3)
public edit Name editname(
boolean _set,
CustTable _CustTable,
Name _name
) // To display name and also we can the Edit name
{
DirPartyTable dirpartytable;
if (_set)
{
ttsBegin;
dirpartytable = DirPartyTable::findRec(CustTable::find(this.AccountNum).Party,true);
dirpartytable.Name = _name;
dirpartytable.update();
ttsCommit;
}
return _CustTable.name();
}
N ow Create a new Form like below:
Add the fields like above in grid set datasource as custtable and fill the datamethod property of all fields respectively
what is "DirPartyTable" in 3rd Method ?
ReplyDelete