Показать сообщение отдельно
Старый 07.11.2012, 17:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,643 / 848 (80) +++++++
Регистрация: 28.10.2006
Malaysia: Storing last form values
Источник: http://axmas.blogspot.com/2012/11/st...rm-values.html
==============


1. In the AOT, find the LedgerJournalTable form, and add the following code to the bottom of its class declaration:

AllOpenPosted showStatus;
NoYes showCurrentUser;
#define.CurrentVersion(1)
#localmacro.CurrentList
showStatus,
showCurrentUser
#endmacro

2. Create the following additional form methods:
public void initParmDefault()
{
showStatus = AllOpenPosted::Open;
showCurrentUser = true;
}


public container pack()
{
return [#CurrentVersion, #CurrentList];
}


public boolean unpack(container _packedClass)
{
int version = RunBase::getVersion(_packedClass);


switch (version)
{
case #CurrentVersion:
[version, #CurrentList] = _packedClass;
return true;
default:
return false;
}
return false;
}


public IdentifierName lastValueDesignName()
{
return element.args().menuItemName();
}


public IdentifierName lastValueElementName()
{
return this.name();
}


public UtilElementType lastValueType()
{
return UtilElementType::Form;
}


public UserId lastValueUserId()
{
return curUserId();
}


public DataAreaId lastValueDataAreaId()
{
return curext();
}


3. Add the following code to the form's run() method right before its super():

xSysLastValue::getLast(this);
AllOpenPostedField.selection(showStatus);
ShowUserCreatedOnly.value(showCurrentUser);

4. Add the following code to the bottom of the form's close() method:

showStatus = AllOpenPostedField.selection();
showCurrentUser = ShowUserCreatedOnly.value();
xSysLastValue::saveLast(this);





Источник: http://axmas.blogspot.com/2012/11/st...rm-values.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.