HI Folks,
Hope this will help you..In the following scenario we have to insert records in CustGroup from the child form.
As shown below. Can be achieve by using FormDataSource or FormObjectSet classes.
Note: formDataSource = element.args().record().dataSource(); // _object = element.args().record().dataSource();
Step 1 create a button in cust goup form
Step 2 In this button write the below code where you are calling a form and passing the record.
void clicked()
{
Args args;
FormRun formRun;
super();
args = new args("CustGroupCreate");
formRun = new FormRun(args);
args.record(CustGroup);
formRun.init();
formRun.run();
formRun.wait();
}
Step 3 Create new form called "CustGroupCreate" as shown below with unbounded controls.
Step 4 Declare a variable for FormDataSource class in as shown below :
public class FormRun extends ObjectRun
{
FormDataSource formDataSource; // FormObjectset _object;
CustGroup localCustGroup;
}
Step 5 Override a init() method and write the below code to get the parent form datasource.
public void init()
{
super();
if(element.args().record())
formDataSource = element.args().record().dataSource(); // _object = element.args().record().dataSource();
}
Step 6 Take another override method close()and code for insertion and using the formDataSource variable refresh the parent Data Source as shown below. Once you you insert a record and close the form that will refresh the parent Data source immediately.
public void close()
{
super();
localCustGroup.CustGroup = CustGroup_CustGroup.text();
localCustGroup.Name = CustGroup_Name.text();
localCustGroup.PaymTermId = CustGroup_PaymTermId.text();
localCustGroup.insert();
formDataSource.research(true); // _object.research(true);
}
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.
29 April 2014
25 April 2014
Hi, Friends,
below code will helps to convert the sting to barcode, you just pass the string type and get the barcode
str 128 Convert2Code128(str _str)
{
BarCode barCode1 = BarCode::construct(barCodeType::Code128);
;
barCode1.string(true, strUpr(_str));
barCode1.encode();
return barCode1.barcodeStr();
}
then setup the properties as below:
below code will helps to convert the sting to barcode, you just pass the string type and get the barcode
str 128 Convert2Code128(str _str)
{
BarCode barCode1 = BarCode::construct(barCodeType::Code128);
;
barCode1.string(true, strUpr(_str));
barCode1.encode();
return barCode1.barcodeStr();
}
then setup the properties as below:
10 April 2014
UTCDateTime to Date conversion and date comparition
HI Guys,This may be useful for you.
Date _date;
_date = DateTimeUtil::date(testTable.CraetedDateTime); // _time = DateTimeUtil::Time(testTable.CraetedDateTime); to get time
if(_date <= 31\12\2010) // dd\mm\yyyy
// do some thing
Thanks
Sunil
Date _date;
_date = DateTimeUtil::date(testTable.CraetedDateTime); // _time = DateTimeUtil::Time(testTable.CraetedDateTime); to get time
if(_date <= 31\12\2010) // dd\mm\yyyy
// do some thing
Thanks
Sunil
Subscribe to:
Posts (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...