Hi,
1. Create a table,
2. Use the 2 EDTs and make it one as index as unique by property AllowDuplicates : NO
3. Create a find method in the table using below code and patten
static TableName find(UsedEDT _UsedEDT ,
boolean _forUpdate = false,
ConcurrencyModel _concurrencyModel = ConcurrencyModel::Auto)
{
TableName tableName ;
if (_UsedEDT)
{
if (_forUpdate)
{
tableName .selectForUpdate (_forUpdate);
if (_concurrencyModel != ConcurrencyModel::Auto)
tableName .concurrencyModel(_concurrencyModel);
}
tableName .selectLocked (_forUpdate);
select firstonly tableName
index hint UsedEDTIndex
where tableName.UsedEDT == _UsedEDT ;
}
return tableName ;
}
/************************Using the find method **********************/
Using the display method with find() we can get that value by using below codes in the table.
display Name name()
{
return TableName::find(this.UsedEDT).name();
}
1. Create a table,
2. Use the 2 EDTs and make it one as index as unique by property AllowDuplicates : NO
3. Create a find method in the table using below code and patten
static TableName find(UsedEDT _UsedEDT ,
boolean _forUpdate = false,
ConcurrencyModel _concurrencyModel = ConcurrencyModel::Auto)
{
TableName tableName ;
if (_UsedEDT)
{
if (_forUpdate)
{
tableName .selectForUpdate (_forUpdate);
if (_concurrencyModel != ConcurrencyModel::Auto)
tableName .concurrencyModel(_concurrencyModel);
}
tableName .selectLocked (_forUpdate);
select firstonly tableName
index hint UsedEDTIndex
where tableName.UsedEDT == _UsedEDT ;
}
return tableName ;
}
/************************Using the find method **********************/
Using the display method with find() we can get that value by using below codes in the table.
display Name name()
{
return TableName::find(this.UsedEDT).name();
}
This comment has been removed by the author.
ReplyDeletereturn TableName::find(this.UsedEDT).name();
ReplyDeleteI got error in this line as syntax error.... Please clear that..
Let's say that you
ReplyDeleteHow to use find method in Modified method in another table to copy the value from TableName.Name to Table2.Name after modifying field Table2.Code?