SysOperationProgress is a class to use operation progress indicator
find the below sample code for an example:
static void SysOperationProgress_PrimeNumber(Args _args)
{
#avifiles
boolean checkPrime,_showProgess = true;
SysOperationProgress progressBar = new SysOperationProgress();//
int counter,out;
;
counter = 1;
out = 1000;
while(counter < out)
{
checkPrime = ((counter mod 2)!=0 && (counter mod 3) !=0);
if(checkPrime)
{
info(strfmt("its a prime number %1",counter));
}
progressBar.setCaption(strfmt("Generating the prime number for %1",counter));
progressBar.setAnimation(#aviUpdate);//#AviFindFile);
progressBar.setText(strfmt("Processing %1 out of %2",counter,out));
counter++;
}
}
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.
01 March 2013
27 February 2013
New line or break lines with windows applications like OutLook,HTML and XML
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..:-)
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..:-)
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)
How to add the Display method in the form level in D365 F&O
The below examle is to add the form -Data source level adding display method and assigning to form design control.
-
static void createForm(Args _args) { Args args; Form form; FormRun formRun; FormBuildDesign formBuildDesign; FormB...
-
Please click here to access Custom Workflow step by step process:
-
{ "Message" : "Please verify that the user is valid and set up correctly." } Sol: System Administration > Se...