Dynamics AX has a very useful feature, which allows saving the latest user choices per user per form. This feature is implemented across a number of standard reports, periodic jobs, and other objects, which require user input.
In this recipe, we will see how to store the latest user filter selections. To make it as simple as possible, we will use existing filters on the General journal form, which can be opened from General ledger | Journals | General journal. This form contains two filters—Show and Show user-created only. Show allows displaying journals by their posting status and Show user-created only toggles between all journals and the currently logged user's journals.
1.Find the LedgerJournalTable form in AOT, 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 these 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();
}
This blog is for Dynamics AX (AXAPTA) Developers,this will help you for your development issues. This site contains some Microsoft Dynamics AX X++ Codes for use in your day to day use.
Subscribe to:
Post Comments (Atom)
Ledger Voucher creation Framework and x++ code to create ledger voucher
Please click her for MS reference file Below is the out of the box example reference and code. SalesInvoiceJournalPostSubBill_Extension-...
-
{ "Message" : "Please verify that the user is valid and set up correctly." } Sol: System Administration > Se...
-
Please click here to access Custom Workflow step by step process:
-
FormRun formRun = sender.formRun(); Object inventTrans_ds = formRun.dataSource(formDataSourceStr(InventMarking,InventTransO...
No comments:
Post a Comment
Give me the commetns and solutions