When ever sending the email by using the parameters:
to show receive email line by line in out look have to use
while passing the parameter:
Ex:
while()
{
log = strfmt('Messge for body line'+ '');// to break lines when interfacing with windows applications
}
Class::emailNotification('abc@yahoo.com','xyx@yahoo.com','Subject txt',log)
//in log varialble there are multibple lines so
is the tab to break lines and show in out look mail.
Static void emailNotification(str fromEmail, str toEmail,str subject, str body)
{
SysMailer mailer = new SysMailer();
SysEmailParameters parameters = SysEmailParameters::find();
;
if (parameters.SMTPRelayServerName)
{
mailer.SMTPRelayServer(parameters.SMTPRelayServerName,
parameters.SMTPPortNumber,
parameters.SMTPUserName,
SysEmailParameters::password(),
parameters.NTLM);
}
else
{
mailer.SMTPRelayServer(parameters.SMTPServerIPAddress,
parameters.SMTPPortNumber,
parameters.SMTPUserName,
SysEmailParameters::password(),
parameters.NTLM);
}
mailer.fromAddress(fromEmail);
mailer.tos().appendAddress(toEmail);
mailer.subject(subject);
mailer.htmlBody(body);
mailer.sendMail();
}
Thanks for reading..:-)
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.
27 February 2013
21 February 2013
Date Time / UTCDateTime
static void DateTime(Args _args)
{
UtcDateTime dateTime;
;
dateTime = DateTimeUtil::newDateTime(systemdateget(),DateTimeUtil::time(DateTimeUtil::getSystemDateTime()));
info(datetime2str(dateTime));
}
{
UtcDateTime dateTime;
;
dateTime = DateTimeUtil::newDateTime(systemdateget(),DateTimeUtil::time(DateTimeUtil::getSystemDateTime()));
info(datetime2str(dateTime));
}
08 February 2013
X++ code to open a form or menuitem AXAPTA
how to open a form by using x++ code:
static void OpenDisplayMenuItem()
{
Args args = new Args();
;
args.record(VendTable::find("XYZ"));
new MenuFunction(MenuItemDisplayStr(VendTable),MenuItemType::Display).run(Args);
}
------
static void OpenForm()
{ FormRun formRun;
Args args = new Args();
;
args.name(formstr(VendTable));
args.record(CustTable::find("XYZ"));
formRun = ClassFactory.formRunClass(args);
formRun.init();
formRun.run();
formRun.wait();
}
static void OpenDisplayMenuItem()
{
Args args = new Args();
;
args.record(VendTable::find("XYZ"));
new MenuFunction(MenuItemDisplayStr(VendTable),MenuItemType::Display).run(Args);
}
------
static void OpenForm()
{ FormRun formRun;
Args args = new Args();
;
args.name(formstr(VendTable));
args.record(CustTable::find("XYZ"));
formRun = ClassFactory.formRunClass(args);
formRun.init();
formRun.run();
formRun.wait();
}
07 February 2013
like operator in Axapta
To get matching words in query
static void Job587(Args _args)
{
CustTable custTable;
select custTable where custTable.Name like("*john*");// match with john
select custTable where custTable.Name like("*john");// end with with john
select custTable where custTable.Name like("john*");// start with john
info(custTable.Name);
}
static void Job587(Args _args)
{
CustTable custTable;
select custTable where custTable.Name like("*john*");// match with john
select custTable where custTable.Name like("*john");// end with with john
select custTable where custTable.Name like("john*");// start with john
info(custTable.Name);
}
Cannot edit a record in Sales orders (SalesTable). An update conflict occurred due to another user process deleting the record or changing one or more fields in the record.
ttsbegin;
salesTable.reread() /* <--Have to call before update a record*/
if(salesTable.recid)
{
salesTable.update()
}
ttscommit;
02 February 2013
Calling the manu item name in form initiation
Calling the manu item name in form initiation
Form init method()
element.args().menuItemName() == menuitemDisplayStr(GPI_CopyProduct)
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...