Dialog in AX 2012 (MultiSelect control in Dialog):
Hi, let me walk-through the
dialog feature in AX 2012.
Sometime when developing complex
functionality, Dialog plays a significant role. Creation of dialog always provide
you lot of standard features such as standard dialog form throughout ax, batch
tab under form, validations, pack – unpack to persist the last storage value,
to select query values(SysQuery form) etc..
Illustrating the dialog in AX2012
– Creation of dialog fields using standard dialogfield methods (which gives us
lookup using EDT) or get custom lookup using formbuild control under the dialog
and also get an benefit of having multi select under lookups. At the same time
we can also achieve Sysquery form (Select button) under the dialog through
classes.
We can have multi select control
for dialog field using code below:
class VT_DialogEx extends RunBaseBatch
{
DialogField df,
df1;
CustAccount ct;
DialogGroup dfg,
dfg1;
CustAccount dfval;
QueryRun
queryRun;
FormStringControl fsc;
FormBuildControl fbc;
FormBuildStringControl fbsc;
SysLookupMultiSelectCtrl sysms;
container conValues;
}
protected Object dialog()
{
DialogRunbase dialog = super();
dialog.allowUpdateOnSelectCtrl(true);
dfg1 =
dialog.addGroup("Standard Lookup");
df =
Dialog.addField(extendedTypeStr(CustAccount));
df1 =
dialog.addFieldValue(extendedTypeStr(Name),"");
df1.allowEdit(false);
dfg =
dialog.addGroup("Custom Lookup");
fbc =
dialog.formBuildDesign().control(dfg.name());
fbsc =
fbc.addControl(FormControlType::String, "User
id");
fbsc.label("User id");
return dialog;
}
public void
dialogPostRun(DialogRunbase dialog)
{
FormRun fr;
super(dialog);
fr =
dialog.dialogForm().formRun();
if (fr)
{
sysms
= SysLookupMultiSelectCtrl::construct(fr, Fr.design().control(fbsc.id()), queryStr(VT_UserInfoQuery));
}
// dialog.formRun().controlMethodOverload(true);
// dialog.formRun().controlMethodOverloadObject(this);
}
public void
initParmDefault()
{
Query
query;
;
super();
query = new Query();
query.addDataSource(tableNum(vendtable));
queryRun
= new QueryRun(query);
}
public QueryRun queryRun()
{
;
return queryRun;
}
As shown in above image we get
multi select option for Userid field in dialog and once clicking on ok button retrieve
the dialog field using code below:
public boolean
getfromdialog()
{
boolean ret;
// info(strFmt("%1", df.value()));
dfval =
df.value();
conValues
= sysms.get();
//info(strFmt("%1",
con2StrUnlimited(convalues)));
return super();
}
Do let me know if you are looking for XPO of it.
Stay tuned.. Happy Daxing J
how to do it in ssrs???
ReplyDeletei am trying to add a report parameter in rdp which take multiple value but it is not taking the value can you send any work on ssrs report at rohitsinghbatchu@hotmail.com thanks you.
DeleteCreate UIBuilder class for the report and under the PostRun method using "registerOverrideMethod" you can use --> SysLookupMultiSelectGrid::lookup(query, _control, _control, cnt);
DeleteSoon going to post on the specified topic. Thanks & Keep visting for more threads.
thanks vishal for your reply but i get empty mutliselect box i have creatyed a static query and tried it out with dynamic query but nothing seems to work!!!!!
Deletei get a blank multiselect box and query has all the data.............
DeleteXPO please. navinkeshav@gmail.com
ReplyDeletePlease check it :) Thanks
DeleteHi Vishal
DeleteCan i have XPO file
Hi may i ask for the XPO? thank you. siasonivan@gmail.com
ReplyDeleteHi,
ReplyDeleteI would also like the XPO please. fredrik.brandt@gmail.com
Thanks.
/Fredrik.
Please sendme xpo, for this example.
ReplyDeleteXPO please. jkarlyt@yahoo.com.mx
ReplyDeleteThanks.
/JCT
Hi Vishal,
ReplyDeleteIts working, thanks for the post.
And i need to filter the multi select control values based on the another control of the same dialog.
Hi Vishal Tiwari,
ReplyDeletePlease send me xpo for example.
arip.saepudinn@gmail.com
Thanks
Hi Vishal,
ReplyDeletePlease send me xpo on paragchapre@gmail.com
Hi Vishal,
ReplyDeletePlease send me xpo on s.sanamehmood@gmail.com
Thanks
Hi Vishal,
ReplyDeletePlease send me xpo on ramosjef@gmail.com
Thanks
hi Vishal,
ReplyDeletePlease send me xpo on jintinytiny@yahoo.com
Thanks,
xpo please riksan4444@gmail.com
ReplyDeletePlease martaalfaher@gmail.com
ReplyDeletePlease martaalfaher@gmail.com
ReplyDeleteplz Kameran_lak@libero.it
ReplyDeleteThe variable conValues seems to not be available in the 'run' method. I can't use my multiselected options anywhere outside of 'getFromDialog'.
ReplyDelete