Morning SpAXrtan
Ohayou
Gunaydin
this time i share a steps how to get value from Parent form,wraped it become parameter,send to child form.
> Create a Display menuItem of child form
> Drag it to Parents form to become a button.
> Override the method click of menuItem button
// #! INCIDENT !#.LAST.04.06.15.Husna.Yu:
//Menangkap nilai yang disortir digrid(diform parent),dijadikan parameter lalu dilempar ke form child
void clicked()
{
/*
Args args;
FormRun formrun;
super();
args = new Args(formStr(PTGITTransaction));
args.record(PTGITInventtable);
formrun = classFactory.formRunClass(args);
formrun.init();
*/
Args parameters = new Args();
MenuFunction addressFormatmenu;
;
addressFormatmenu = new MenuFunction(menuitemDisplayStr(PTGITTransaction),MenuItemType::Display);
parameters.caller(element);
parameters.parm(Grid_PTGItemcode.text());
addressFormatmenu.run(parameters);
}
> on the datasource of childs form, overide the init method
// #! INCIDENT !#.LAST.04.06.15.Husna.Yu:
public void init()
{
FormRun callerForm = element.args().caller();
super();
if(callerForm)
{
if(callerForm.name() == formStr(PTGITInventtable))
{
//info(element.args().parm()); //cek parameter yang dilempar
this.query().dataSourceNo(1).addRange(fieldNum(vwPTGITJournaltrans, PTGItemcode)).value(element.args().parm()); //memfilter record datasource agar menampilkan data sesuai parameter (element.args().parm())
}
}
}
done.
http://microsoft.public.axapta.programming.narkive.com/ZnRRSzzp/set-form-data-source-filter-from-x
All Archives in this blog may be used for the Junior,Dummies or someone who just started for career at Dynamics Ax ... A Place Where U can Start ur Code - right here ...
Langganan:
Postingan (Atom)
Erorr CS1963 - An expression tree may not contain a dynamic operation.
Kali ini saya mendapatkan erorr dengan code CS1963, padahal sebelumnya saya sudah mendefinisikan 'var item in Model' di @foreach(var...
-
My code here is to copy Purchase Agreement line from reference Purchase Agreement to new Purchase Agreement. static void PSMCopydirecttoag...
-
If you want to try custom your notification, AX Standard can bring the user to the form where the information exist but when the form was...
-
"Error while setting server report parameters. Error Message: The item ´/DynamicsAx/PurchPurchaseOrderreport.Report4´ cannot be found ...