Multi-select lookup dialog for SSRS Report Parameter in Dynamics Ax


Description:-

In your data contract class declaration method, define your parameter with 'List'. For example I want to create a multi select dialog for customers in which I need Customer account to be selected when a user selects any customer. 
SO, I will write List accountNum; In your DataMemberAttribue method type the following code.

[DataMemberAttribute('AccuontNum'),AifCollectionTypeAttribute('AccountNum', Types::String),
SysOperationLabelAttribute(literalstr("@SYS302")) ]
public List parmAccountNum(List _accountNum = accountNum)
{
    accountNum = _accountNum;
    return accountNum;
}

Now that you have completed the contract class, let’s move on to. The UI Builder class. In your main lookup method write the following code.

public void lookup(FormStringControl    _control)
{
    Query query = new Query(queryStr(CustTableSRS));
    container   cnt;
    SysLookupMultiSelectGrid::lookup(query, _control, _control, cnt);
}

you may have to create 3 more methods to run your code without any error. They are etFromDialog, initializeFields and postRun. Here is the code for these methods. you have to change the contract class name with your contract class First create a new mothod for initializeFields and paste the following code

public void initializeFields()
{
    custMultiSelectContract contract = this.dataContractObject();
}

Then create another method for getFromDialog

public void getFromDialog()
{
    custMultiSelectContract contract =  this.dataContractObject();
    super();
}

and then another method for postRun

public void postRun()
{
    custMultiSelectContract contract = this.dataContractObject();
}

Related Posts

Previous
Next Post »

1 comments:

comments
Anonymous
April 22, 2018 at 8:56:00 AM GMT+5:30 delete

It's hard to come by educated people on this topic, however, you seem like you know what you're talking about!

Thanks

Reply
avatar

Thanks for comments.....