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();
}
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCARcO4IEv48MaGpCUUi1aCAb6joLAplbt26dfFYe9fR7Dct883mmWFSFezMA9dGpmNBQl94LPBOh6yQyE_Fn8wBdYwwz2pGpGuVGAj70e9GV07H06YbzjGYun7ffFlMqt9ACXxipwxEyo/s400/Capture.JPG)
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
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_CTEeqatEnHbJWmrzzLWFoEuL1ygcEehxHfAla58bJybm37Gs22OlfGXTiFv9kqBwd5MgvmiiF1bIPevxemdbgAY71TjSemmKEKa8DJ3MK-Tf354LoMHSyrjaZNprYrrlMeJ0LLL4ql4f/s400/2-16-2016+12-54-53+PM.jpg)
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:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRp0NIrqpAuHUqzsW6rOppKLv9RB3ivIzc59uOXv15vO5UkP24C92EsVvE75lV2kAGbUZZ4TcnZ0s4uwlQlezbtZHBaL5y60E14cmBlEg4YNBwROwiKa2icxVCfFHJypH4hvMfKmVY51Sc/s640/2-16-2016+12-48-27+PM.jpg)
Add the fields like above in grid set datasource as custtable and fill the datamethod property of all fields respectively
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_CTEeqatEnHbJWmrzzLWFoEuL1ygcEehxHfAla58bJybm37Gs22OlfGXTiFv9kqBwd5MgvmiiF1bIPevxemdbgAY71TjSemmKEKa8DJ3MK-Tf354LoMHSyrjaZNprYrrlMeJ0LLL4ql4f/s400/2-16-2016+12-54-53+PM.jpg)
what is "DirPartyTable" in 3rd Method ?
ReplyDelete