Pack
this method is a standard method inherited from RunBase. It is used to save
the values that the user selects and store them until the next time the user executes the class.
Public container pack ()
{
return [#CurrentVersion, #CurrentList];
}
unpack
Standard method inherited from RunBase and used to fetch the values that the user selected the previous time he executed the class.
public boolean unpack(container packed Class)
{
Version version = RunBase::getVersion(packedClass);
;
switch (version)
{
case #CurrentVersion:
[version, #CurrentList] = packedClass;
break;
default:
return false;
}
return true;
}
How the values will be stored in pack
Example :
I am having values customer account, transdate
In Class declaration
// Packed
TransDate transDate;
CustAccount custAccount;
#define.CurrentVersion(1)
#define.Version1(1)
#localmacro.CurrentList
transDate,
custAccount
#endmacro
#define.currentVersion(1) -Version stored in the cache by list
(how many values added here 1) what if you are going to add one more field on
that list. then you need to increase the version by 1 (at your choice but the
version must differ numerically like #define.currentVersion(2)) because cache
knows version 1 has 1 variables and version 2 has 2 variables.
#localmacro.currentList
...........#endmacro -
it describes what are all the variables we are going to store.
SysSaveable -- Class stores values
Public void initParmDefault()
{
transDate
custAccount
}
Above methods combine to ensure the values that needed by xSysLastValue.savelast method.This values are needed to maintain different user store values different objects in different companies.
Override close() method by below coding
public void close()
{
;
custAccount = ComboBox.selection();
transDate =
xSysLastValue::saveLast(this);
super();
}
when the form closes this system
method triggered. here the xSysLastValue class send the user selected values to
cache.
To retrieve last values
public void run()
{
//called before opeing the form
super();
//get the last value stored in cache
//here unpack method used
xSysLastValue::getLast(this);
//set the last user selection on the field
Custaccoun.selection(custAccount);
}
Refresh
refresh() will not reread the record from the database. It basically just refreshes the screen with whatever is stored in the form cache.
Reread
reread() will only re-read the CURRENT record from the DB so you should not use it to refresh the form data if you have added/removed records. It's often used if you change some values in the current record in some code, and commit them to the database using .update() on the table, instead of through the form datasource. In this case .reread() will make those changes appear on the form.
the values that the user selects and store them until the next time the user executes the class.
Public container pack ()
{
return [#CurrentVersion, #CurrentList];
}
Standard method inherited from RunBase and used to fetch the values that the user selected the previous time he executed the class.
public boolean unpack(container packed Class)
{
Version version = RunBase::getVersion(packedClass);
;
switch (version)
{
case #CurrentVersion:
[version, #CurrentList] = packedClass;
break;
default:
return false;
}
return true;
}
How the values will be stored in pack
Example :
I am having values customer account, transdate
In Class declaration
// Packed
TransDate transDate;
CustAccount custAccount;
#define.CurrentVersion(1)
#define.Version1(1)
#localmacro.CurrentList
transDate,
custAccount
#endmacro
#define.currentVersion(1) -Version stored in the cache by list
(how many values added here 1) what if you are going to add one more field on
that list. then you need to increase the version by 1 (at your choice but the
version must differ numerically like #define.currentVersion(2)) because cache
knows version 1 has 1 variables and version 2 has 2 variables.
#localmacro.currentList
...........#endmacro -
it describes what are all the variables we are going to store.
Public void initParmDefault()
{
{
transDate
custAccount
}
Above methods combine to ensure the values that needed by xSysLastValue.savelast method.This values are needed to maintain different user store values different objects in different companies.
Override close() method by below coding
public void close()
{
;
custAccount = ComboBox.selection();
transDate =
xSysLastValue::saveLast(this);
super();
}
when the form closes this system
method triggered. here the xSysLastValue class send the user selected values to
cache.
To retrieve last values
public void run()
{
//called before opeing the form
super();
//get the last value stored in cache
//here unpack method used
xSysLastValue::getLast(this);
//set the last user selection on the field
Custaccoun.selection(custAccount);
}
Refresh