In dynamics AX, working
with forms, there are times when you need to pass some information from current
form to the opened form, so the question arrived is that what's the best way to
open the new form and pass information.
Answer: It depends upon
the information that is needed in the new form; there is Args class that plays
an important role to pass the information. Let’s take a look on some of the
important methods of that class
Args class (Argument)
"The Args class is
used to pass arguments such as a name, a caller, and parameters between
application objects"
Some important methods are
Caller
|
Gets or sets the
instance of the object that created this instance of the Args class.
|
name
|
Gets and sets the name
of the application object to call.
|
parm
|
Gets or sets a string
that specifies miscellaneous information for the called object.
|
parmEnum
|
Gets or sets the
enumeration value of the enumeration type that is specified in the
parmEnumType method.
|
parmEnmType
|
Gets or sets the ID
value of any enumeration type.
|
ParmObject
|
Gets or sets an instance
of any object to pass to the called object.
|
record
|
Gets and sets the record
from the table on which the caller object is working.
|
There are four methods
that can be used to pass extra information to the new class:
- The parm method – to pass strings
- The parmEnum and parmEnumType method – to pass enumeration values
- The parmObject method – to pass an object of any type.
1.
If you need a
data from the parent form main data source for the current record, so you don’t
need to do anything in parent, just create a display menu item and give the
form name that needs to be opened, create a menuItem button and assign the
newly created menu item.
Override
the Init method on opened form
And
you get the parent dataset records as
element.args().record()
2.
Need to pass any
object/string/Enum
Use
the same approach for creating the button
Parent
form
void clicked()
{
Args args;
FormRun formRun;
super();
args = new Args(formstr(FormName));
{
Args args;
FormRun formRun;
super();
args = new Args(formstr(FormName));
//
To pass any string value
args.parm(<string value>);
args.parm(<string value>);
//
To pass any object
args.parmObject(<object>);
args.parmObject(<object>);
//
To pass any Enum
args.parmEnum( EnumValue);
args.parmEnumType( EnumNum( <EnumName>) );
args.parmEnumType( EnumNum( <EnumName>) );
formRun
= classFactory.FormRunClass(args);
formRun.init();
formRun.run();
formRun.wait();
formRun.detach();
parenttable_ds.refresh(); // Refreshing parent table DataSourceTable
parenttable_ds.executeQuery(); // Refreshing Parent DataSourceTable
}
formRun.init();
formRun.run();
formRun.wait();
formRun.detach();
parenttable_ds.refresh(); // Refreshing parent table DataSourceTable
parenttable_ds.executeQuery(); // Refreshing Parent DataSourceTable
}
Child
Form
void init()
{
args = element.args();
{
args = element.args();
// get string
parameter
<string> = args.parm();
<string> = args.parm();
// get object
parameter
<object>
= args.parmObject();
// get
enum parameter
if( element.args().parmEnumType() == EnumNum( <EnumName>) )
{
<enum contol/variable> =( element.args().parmEnum() );
}
if( element.args().parmEnumType() == EnumNum( <EnumName>) )
{
<enum contol/variable> =( element.args().parmEnum() );
}
}
3. There are many parameters that you need to pass to the child form.
3. There are many parameters that you need to pass to the child form.
In that scenario, you need to create an extra class (parameter/contract
class), you can first set the parameters in the init method for that class, use
the parmObject for setting and gets the object on the child form
I Want to pass 2 parameter to new form, Do I have to write one more Parm method? Or use the Parm() method, if use the Parm(), please guide me how to use it?
ReplyDeleteDear All,
ReplyDeleteI want table record data from one form to other menu item display form with parameter.
please i need your help with code.
Thanks,
Aman Syed
AX Technical Consultant
Dear All,
ReplyDeleteI have created parent table and child table ( myId is used for relationship with this two tables).
Now two forms parent and child form. parent form has a grid that displays the content of parent table.
Child form has a grid that displays the content of Child table.
the task is when i double click the row form parent form its corresponding row from child table must be displayed in child form.
(i have overridden mouse double click method in grid for opening the child form but child form display all the rows. but i need only the details of the row which i have clicked)
Thanks in advance,
Riyaz.
You can see Ax related videos from this link
ReplyDeletehttps://www.youtube.com/user/sksingh1980
Good post please visit here to get more technical material for ax
ReplyDeletehttp://daynamicsaxaptatutorials.blogspot.com
Gümüşçay
ReplyDeletePaşaköy
Saraykent
Çarşı
Demirtaş
L0O0
elazığ
ReplyDeleteerzincan
bayburt
tunceli
sakarya
DK81
9F4AB
ReplyDeleteKars Lojistik
Çerkezköy Evden Eve Nakliyat
Zonguldak Lojistik
Aydın Parça Eşya Taşıma
Silivri Evden Eve Nakliyat
Aksaray Parça Eşya Taşıma
Btcturk Güvenilir mi
Aydın Evden Eve Nakliyat
Afyon Lojistik
F3438
ReplyDeleteAnkara Boya Ustası
Aion Coin Hangi Borsada
Tunceli Şehir İçi Nakliyat
Kayseri Şehir İçi Nakliyat
Giresun Evden Eve Nakliyat
Yenimahalle Fayans Ustası
Big Wolf Coin Hangi Borsada
Zonguldak Lojistik
Muş Parça Eşya Taşıma
A3880
ReplyDeleteMardin Parça Eşya Taşıma
Pursaklar Boya Ustası
Çorum Şehirler Arası Nakliyat
Ardahan Şehirler Arası Nakliyat
Qlc Coin Hangi Borsada
Çerkezköy Evden Eve Nakliyat
Niğde Evden Eve Nakliyat
Ünye Asma Tavan
Karabük Lojistik
FD710
ReplyDeletereferanskodunedir.com.tr
8397E
ReplyDeleteReferans Kimliği Nedir
Yeni Çıkan Coin Nasıl Alınır
Coin Kazanma Siteleri
Telegram Görüntüleme Hilesi
Facebook Sayfa Beğeni Hilesi
Twitch Takipçi Satın Al
Sohbet
Bitcoin Nasıl Üretilir
Görüntülü Sohbet
Nursing jobs in Germany offer Indian nurses a unique opportunity to enhance their careers in a progressive healthcare system. With an increasing demand for skilled professionals, these positions provide competitive salaries and excellent benefits, making them highly attractive. Prospective candidates will find many healthcare facilities keen to hire international talent, often providing necessary assistance with visa applications and relocation. Professional development is a priority, with ongoing training and education programs to improve clinical skills. Language proficiency in German is essential, but many institutions offer language courses to help new hires integrate more smoothly. Embrace the chance to work in a diverse and multicultural environment where your contributions to patient care are valued. Experience the richness of cultural exchange while making a significant impact in the lives of patients. This is an ideal pathway for Indian nurses looking to broaden their horizons and seek professional growth abroad.
ReplyDeletehttps://www.dynamichealthstaff.com/nursing-jobs-in-germany-for-indian-nurses