To send a mail with attachments click here:
sysInetMail::sendEMail
smmOutlookEMail
Form-smmEncyclopedia
--
static void sendEmail(Args args)
{
smmOutlookEMail smmOutlookEMail = new smmOutlookEMail();
Object smmSendEmail;
container c;
;
args = new Args();
args.name(formstr(smmSendEmail));
args.caller(smmOutlookEMail);
smmSendEmail = classfactory.formRunClass(args);
if (smmSendEmail)
{
smmSendEmail.init();
smmSendEmail.setEmailTos("aaa@gmail.com");
smmSendEmail.setEmailSubject("Sunil");
smmSendEmail.setAttachments(["D:\SUN\I & C.pdf"]);
smmSendEmail.run();
smmSendEmail.refreshControl();
smmSendEmail.wait();
}
}
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.
13 December 2010
08 December 2010
To make a form in select mode ( Form in Lookup)
Which form want to open in lookup
form->methods->init()
element.selectMode(StringEdit);
form->methods->init()
element.selectMode(StringEdit);
Add a value to Year in date
Add a value to Year in date
static void YearInDate(Args _args)
{
Date date1,date2;
int length,day,mth,years;
;
length = 2;
date1 = systemdateget();
day = dayofmth(Systemdateget());
mth = mthofyr(SystemDateget());
years = year(SystemDateget());
date2 = mkdate(day,mth,years+length);
print date2;
pause;
}
static void YearInDate(Args _args)
{
Date date1,date2;
int length,day,mth,years;
;
length = 2;
date1 = systemdateget();
day = dayofmth(Systemdateget());
mth = mthofyr(SystemDateget());
years = year(SystemDateget());
date2 = mkdate(day,mth,years+length);
print date2;
pause;
}
07 December 2010
validation to allow only alphabets in textControl
validation to allow only alphabets in textControl
Form->design->StringControl->method->validate()
public boolean validate()
{
boolean ret;
;
if(strnfind(this.text(),'ABCDEFGHIJKLMNOPQRSTUVWXYZ',1,strlen(this.text())))
{
info("enter only alfa");
}
else
{
ret = super();
}
return ret;
}
Form->design->StringControl->method->validate()
public boolean validate()
{
boolean ret;
;
if(strnfind(this.text(),'ABCDEFGHIJKLMNOPQRSTUVWXYZ',1,strlen(this.text())))
{
info("enter only alfa");
}
else
{
ret = super();
}
return ret;
}
Table Fields in Form Lookup / UtileElements
Table Fields in Form Lookup
Form->DS->Field->Method-> lookup()
public void lookup(FormControl _formControl, str _filterStr)
{
SysTableLookup sysTableLookup = SysTableLookup::newParameters(Tablenum(Utilelements),_formControl);
Query query = new Query();
QueryBuildDataSource QBDS;
;
SysTableLookup.addLookupfield(fieldnum(Utilelements,name));
QBDS = query.addDataSource(Tablenum(Utilelements));
QBDS.addRange(fieldnum(utilelements,recordtype)).value(queryvalue(UtilelementType::TableField));
QBDS.addRange(fieldnum(Utilelements,ParentId)).value(queryvalue(tablenum(ClinicalMaster)));
sysTableLookup.parmQuery(query);
systableLookup.performFormLookup();
//super(_formControl, _filterStr);
}
Form->DS->Field->Method-> lookup()
public void lookup(FormControl _formControl, str _filterStr)
{
SysTableLookup sysTableLookup = SysTableLookup::newParameters(Tablenum(Utilelements),_formControl);
Query query = new Query();
QueryBuildDataSource QBDS;
;
SysTableLookup.addLookupfield(fieldnum(Utilelements,name));
QBDS = query.addDataSource(Tablenum(Utilelements));
QBDS.addRange(fieldnum(utilelements,recordtype)).value(queryvalue(UtilelementType::TableField));
QBDS.addRange(fieldnum(Utilelements,ParentId)).value(queryvalue(tablenum(ClinicalMaster)));
sysTableLookup.parmQuery(query);
systableLookup.performFormLookup();
//super(_formControl, _filterStr);
}
03 December 2010
Add Fields To a Table with X++ , Dynamically
Add Fields To a Table with X++ , Dynamically
There is 2 ways to create a fields for Table.
1.New Table with New Fields
2. Add New fields To Existing Table
1.Create a New Table with New Fields
static void newTableCreate112(Args _args)
{
TreeNode treeNode;
AOTTableFieldList fieldList;
#AOT
;
treeNode = TreeNode::findNode(#TablesPath);
treeNode.AOTadd("Test_ABC");
SqlDataDictionary::synchronize();
//treeNode.AOTfindChild('naresh3');
fieldList = treeNode.AOTfindChild('Test_ABC').AOTfindChild('fields');
fieldList.addString('Name');
fieldList.addInteger('Id');
fieldList.addString('Address');
fieldList.addReal('Salary');
print "Table Created";
pause;
}
2.Add New fields To Existing Table
static void newFieldCreate(Args _args)
{
TreeNode treeNode;
AOTTableFieldList fieldList;
#AOT
;
treeNode = TreeNode::findNode(@'\\Data Dictionary\Tables\Test_ABC\');
fieldList = treeNode.AOTfindChild('fields');
fieldList.addInteger('Mobile');
SqlDataDictionary::synchronize();
print "Field Created";
pause;
}
There is 2 ways to create a fields for Table.
1.New Table with New Fields
2. Add New fields To Existing Table
1.Create a New Table with New Fields
static void newTableCreate112(Args _args)
{
TreeNode treeNode;
AOTTableFieldList fieldList;
#AOT
;
treeNode = TreeNode::findNode(#TablesPath);
treeNode.AOTadd("Test_ABC");
SqlDataDictionary::synchronize();
//treeNode.AOTfindChild('naresh3');
fieldList = treeNode.AOTfindChild('Test_ABC').AOTfindChild('fields');
fieldList.addString('Name');
fieldList.addInteger('Id');
fieldList.addString('Address');
fieldList.addReal('Salary');
print "Table Created";
pause;
}
2.Add New fields To Existing Table
static void newFieldCreate(Args _args)
{
TreeNode treeNode;
AOTTableFieldList fieldList;
#AOT
;
treeNode = TreeNode::findNode(@'\\Data Dictionary\Tables\Test_ABC\');
fieldList = treeNode.AOTfindChild('fields');
fieldList.addInteger('Mobile');
SqlDataDictionary::synchronize();
print "Field Created";
pause;
}
02 December 2010
How to disable the employee field in sysqueryform
How to disable the employee field in sysqueryform
Do u want that field should not appear in sysqueryform
Add a range for that field in data source and set the status to "Hide";
Do u want that field should not appear in sysqueryform
Add a range for that field in data source and set the status to "Hide";
Subscribe to:
Posts (Atom)
Merge Dimensions (MainAccountId and LedgerDimensions) defaultDimension in D365 F&O and X++
public DimensionDynamicAccount getLedgerDimension(container _conData, TransDate _transDate = today()) { int ...
-
Please click here to access Custom Workflow step by step process:
-
public InventQty onHandInventory(ItemId itemId, InventSiteId inventSiteId,InventLocationId inventLocation) { InventOnhand inventOnh...
-
1. In classDeclaration extend SrsReportDataProviderPreProcess instead of SrsReportDataProviderBase 2. Temp table properties should b...