Dynamics AX 4.0 - Smart customizations
This 30 minute talk by MFP explains how you can customize the business logic in Dynamics AX 4.0, in a way that makes future code upgrades easier.
Click here for the link
This site contains some Microsoft Dynamics AX X++ Codes for use in your day to day use. However please use them with caution in production environment. I will not be responsible for any Goof ups. These Codes were created during my free time and may have bugs. Use them at your own discretion. Arijit Basu | India
This 30 minute talk by MFP explains how you can customize the business logic in Dynamics AX 4.0, in a way that makes future code upgrades easier.
Click here for the link
Labels: General
The COM Class Wrapper Wizard is a great utility in DAX 4.01 which helps you create COM Wrapper Classes easily. Apart from the basic Type Libraries available from the Wizard, you can also create your own DLL and use this wizard to interface from DAX.
Ive created a simple DLL (Click here for the Link) , registered it on my PC, used this Wizard to create wrapper class inside AX. Its simple to do :)
A Small Job :) The Celsius / Fahrenheit conversion logic is in my customized DLL :)
Labels: How To's
The DAX 4.01 EP was much awaited as it was based on MS SPS, giving user more flexibility. Ive managed to set up the EP. Folks may get errors while settin it up, but there's a good document on Partnersource which will help you a lot. Remember you gotta enable ASP.NET 2.0 first (ASP.NET v2.0.50727).
Looks kewl..... :)
Labels: General
Download Microsoft Dynamics™ AX 4.0 Service Pack 1 (SP1), the current release of Microsoft Dynamics AX.
Microsoft Dynamics AX 4.0 Service Pack 1 (SP1 - Localized) is the latest version available. SP1 is a full install and recommended for new installations or upgrades from previous versions.
Note: This download has been updated with additional languages since it was first posted.
Click here to download { Requires partnersource Logon }
Labels: General
The Demo Data set for Dynamics AX 4.0 is based on the Global Trade and Manufacturing Company (GTM), a fictitious U.S. based midsized trade and manufacturing company headquartered in Los Angeles. GTM produces and assembles lamps and lamp parts, and trades with customers and vendors in Europe and the U.S. working with relevant currencies.
Click here to download {Requires Partnersource Logon}
Labels: General
Sometimes we have to write some code at a particular place, but not quite sure or something that will have to be added later on. In order to remember the place and what to do, you can use the TODO word. Put this piece of Code where u want to put some code later.
//TODO: I Have to relook at this code --> ARIJIT
On the Complier, this appears on the Tasks Tab of the Compiler.
See Screenshot below.
Labels: How To's
DAX 4.0 comes with ZERO BP errors. Heres how to enable the BP in DAX so as to make your codes BP Complaint.
From the Compiler, Click Setup>Compiler
A Form opens up. Select Diagonistic Level to 'Level 4'. By default its 'Level 3'.Click apply after selection.
Now again from the Compiler, Click Setup>Best Practices. A New Form opens up. Check all the BP rules that you want to apply. Click Apply after Selection.
Now Close the Compiler and Now Compile your Project/Developement and on the BP tab of the Compiler you can see your BP Violations. The Objective is to reduce them to ZERO.
ENJOY :)
Labels: How To's
Below are the steps to show the DAX 3 Menu in DAX 4.0. Remember you cannot change the DAX 4.0 Navigation Pane but you can create a similar toolbar :)
Labels: How To's
At times, you may want a form to be automatically updated at a certain time interval, for example if the data displayed in the form frequently changes or you would like to execute a task from a form at certain time intervals.
All forms inherit properties from the Object kernel class. The SetTimeOut() method is located in this class.
This method is used with three parameters,the first two of which are mandatory.
- The first one indicates the ID of the method to be activated.
- The second indicates the number of thousandths of seconds for the method, specified in the first parameter that is executed.
- The last parameter is a boolean that is used to indicate how the time is measured.
If the parameter is set to true then the idle time is measured from when the keyboard or mouse was used. Use false to indicate that the time should be measure since the last time SetTimeOut() was executed.
You can execute this method from a form with the code:
element.SetTimeOut(identifierstr(YourMethodName),5000,false);
Labels: X++
We often get this MS Outlook prompt when we send email from AX...
There is a Utility which automatically clicks the Yes Button. The Name is ClickYes.
Heres the download link. Its kinda nice.Check it out...
Labels: How To's
If you are familiar with upgrading from earlier versions of Microsoft Dynamics AX, you should be aware that the upgrade scenarios to Microsoft Dynamics AX 4.0, and from Microsoft Dynamics AX 4.0 to Microsoft Dynamics AX 4.0 with Service Pack 1, differ from previous scenarios. A whitepaper is available at Partnersource which describes the steps in upgrading DAX 4.0 to DAX 4.0 SP1.
Click Here for the link {Requires Partnersource Logon}
Labels: General
I thank Microsoft for putting the link to this BLOG on their Dynamics Communities Landing Page on the Microsoft Site.
Click to go to the Dynamics Communities Landing Page on the Microsoft Site
Labels: General
This is how u can call a dll from AX. I have used the Beep function in kernel32.dll
The parameters of Beep are
BOOL Beep(DWORD dwFreq,DWORD dwDuration);
To get more information on Beep Click here
The AX Code is
static void AB_DLL(Args _args)
{
DLL winApiDLL = new DLL('kernel32');
DLLFunction Function = new DLLFunction(winApiDLL,'Beep');
Function.arg(extTypes::DWord,extTypes::DWord);
Function.call(400,1000);
}
Run this and u'll hear a beep (if ur sound is on).
Labels: X++
In August 2006, Microsoft Corporation conducted the Microsoft Dynamics AX™ 4.0 Standard distribution benchmark to measure the performance and scalability characteristics of Microsoft Dynamics AX 4.0 in a simulated distribution scenario. This benchmark exercised core Accounts Receivables scenarios around order entry through invoicing, in addition to Procure to Pay processes around purchase order creation through receiving of goods.
Download White paper {Requires Partnersource Logon}
Labels: General
Microsoft BizTalk Server and Microsoft Dynamics AX: Integration Solutions for the Extended Enterprise White Paper
Large organizations struggle to maintain a balance between centralization in order to control system and information complexity across the extended enterprise and decentralization in order to encourage flexibility and agility among local subsidiaries or divisions. Through deployment of Microsoft Dynamics™ AX and Microsoft® BizTalk Server, enterprises can realize not only a simple, high-value solution that offers visibility, insight and control of information across the entire organization, but also the flexibility and agility that branch offices and subsidiaries require in order to innovate, grow, and compete effectively. This white paper will be of interest to the business decision maker who is looking to find a robust, high value solution that provides cross-functional integration and coordination of business applications and supply chain management applications across the extended enterprise.
Download the white paper {Require Partnersource Logon}Labels: General
The Microsoft Dynamics AX 4.0 version of the Rapid Configuration Tool is now available. This version of the tool builds on the previous two versions and works with the latest release of Microsoft Dynamics AX 4.0.
Download Rapid Configuration Tool (RCT)The Rapid Configuration Tool (RCT) for Microsoft Dynamics AX 4.0 is a tool that supports both partners and customers in the implementation and configuration process by providing and linking project management features, easier configuration access, communication support and documentation on how to configure Microsoft Dynamics AX. The Rapid Configuration Tool consists of functionality implemented as a module within Microsoft Dynamics AX.
{Requires Partnersource Logon}Labels: General
Ive used EmplTable and have exported EmplId & Name. You can extend this :)
static void ArijitExcel(Args _args)
{
EmplTable EmplTableLocal;
SysExcelApplication excelApp;
SysExcelWorkSheet excelWorksheet;
SysExcelRange excelRange;
SysExcelCells excelCells;
SysExcelCell excelCell;
ComVariant cellValue;
Int i=1;
;
excelApp = SysExcelApplication::construct();
cellValue = new ComVariant() ;
excelApp.workbooks().add();
excelWorksheet = excelApp.worksheets().itemFromNum( 1 );
excelCells = excelWorksheet.cells();
while select * from EmplTableLocal
{
excelCells.item(i+4,4).value(cellValue.bStr(EmplTableLocal.EmplId));
excelCells.item(i+4,5).value(cellValue.bStr(EmplTableLocal.Name));
i++;
}
excelApp.visible(true);
//excelApp.quit();
}
Labels: X++
Super() is a call to the overriden method concerned in the super or parent class.
For the click event it does not serve any purpose since there is no change in functionallity if you remove it and you will not get any error.
For example:
if you create a class myCLASS1 and then inherit from it and override a method on it the call to super will execute the code from the inherited class.
If you remove super that code will not be executed and you may write different code for this method in the child class.
Simple :)
Labels: X++
Sometimes when Launching AX, we get an error as shown below :
"Microsoft Business Solutions-Axapta installation has no text file (axsysen-us.ktd)"
The problem is with the ACU config file in the bindir textbox, on the following line:
So change this to:
bindir,Text,C:\mbs\axapta client\Bin
The Ktd files live in the \Bin\ folder instead of the \Appl\ folder.
This will resolve your issue :)Labels: Troubleshooting
The last few weeks were kinda very busy for me as i was responsible for puttin together our team KM Portal. Being a MS freak and since DAX 4 EP is on MS SPS2003 , I decided to go ahead with MS SPS 2003 SP2 and finally it went live today. Here's the home page.
Labels: General
Heres the Code :)
COM wordApplication;
COM wordDocuments;
COM wordDocument;
COM wordRange;
;
wordApplication = new COM("word.application");
wordApplication.visible(TRUE);
wordDocuments = wordApplication.Documents();
wordDocument = wordDocuments.add();
wordDocument.saveas("c:\\YourDocument.doc");
wordDocument.activate();
wordRange = wordDocument.range(0,0);
wordRange.insertafter("Arijit Basu");
wordRange = wordDocument.range(6,19);
wordRange = wordDocument.range(11,26);
wordRange.italic(true);
wordDocument.save();
wordDocument.close();
wordApplication.quit();
Labels: X++
A small challenge for the DAX lovers . MFP has created reated a small crossword using X++ system functions .
The prize is: One copy of "Inside Dynamics AX" - signed by the authors.
Please go to Blog of Michael Fruergaard Pontoppidan {MFP} link to answer this crossword :)
Last date is 20th Dec 2006.
Labels: X++
If you want to implement the pack/unpack mechanism on the Form {like the ones used in Runbase Classes} , it is easy ...
Besides Pack/Unpack, add these methods:
public dataAreaId lastValueDataAreaId()
{
return curExt();
}
private UserId lastValueUserId()
{
return curuserid();
}
private UtilElementType lastValueType()
{
return UtilElementType::Form;
}
private IdentifierName lastValueElementName()
{
return this.name();
}
private IdentifierName lastValueDesignName()
{
return '';
}
void initParmDefault()
{
}
In Close method of the form:
public void close()
{
super();
//add saveLast method after super()
xSysLastValue::saveLast(this);
}
in init method of the form:
public void init()
{
;
//Add getLast method before super()
xSysLastValue::getLast(this);
super();
…
}
Labels: X++
The Consultant Toolkit for Microsoft Business Solutions–Axapta®, now a part of Microsoft Dynamics, includes: step-by-step methodologies, project tools, templates, delivery guides, and packaged service offerings (QuickStart and QuickPlan for Microsoft Business Solutions-Axapta).
DAX Consultant Toolkit { Requires Partnersource Logon }
Its a very good resource for DAX Professionals, DAX Project managers and has tons of useful stuff , templates etc. Worth checking out.
Hope you like it :)
Labels: General
The Microsoft Industry Builder initiative is a structured program in which Microsoft works together with select independent software vendors (ISVs) to deliver complete, top-quality solutions that meet the unique needs of different industries. Microsoft Dynamics AX software solutions that are developed through this program meet Microsoft's strict quality standards and are packaged with a Microsoft-backed customer support offering. Check out just some of the benefits below that the program offers.
Industry solutions for Microsoft Dynamics AX
Labels: General
When Axapta®, now Microsoft® Business Solutions–Axapta { Microsoft Dynamics AX}, was released in 1998, it brought an exciting new object-oriented technology within reach of midsize companies that needed a powerful, scalable business management suite to run their operations. The new solution featured advanced ideas and technology such as:
* Multilanguage, multi-country capability
* Auto size (IntelliMorph), for easy customization
* Feature keys, for easy upgrades
* No fixed numbers
* Keep information stored in one single database
* Separate user interface, business logic and database (3-tier)
Since the release of Axapta 1.0, the solution has expanded dramatically in scope and capability. Read below for a brief history of major releases, as well as the core technological advances.
Axapta 1.0 - March 1998
· Released in the US and Denmark
· Financial, trade, inventory management, logistics and production, Microsoft SQL Server 6.5
Axapta 1.5 - November 1998
Early release in Norway, Sweden, Germany, UK, Netherlands, Austria, Switzerland, Belgium Spain and the European Union
Publishing Manager, call COM, Service Pack technology, Microsoft SQL Server 7.0
Axapta 2.0 - July 1999
Project Accounting module, WMS, External OLAP, Option Pack concept, ActiveX support, COM-connector and an early release of Axapta Object Server
Axapta 2.1 - January 2000
Market demands from Germany, Austria, Switzerland and Spain
Web tools and CSS (The first WebApp), Microsoft SQL Server 2000, database log
Microsoft Windows 2000 logo
Axapta 2.5 – December 2000
Complete Web applications development environment
Auto upgrade tool, ESS (Project), Banking, First step of Load’n’Go, OLAP within Axapta, XML support, FA to Denmark, Austria and UK
Domains and ASP support, DBCS Support
Axapta 2.5 Market Pack – October 2001
Released in France and Italy
Marketing Automation (CRM), Commerce Gateway, Product Builder (Web application as well), training and Event Management (Web application as well)
Microsoft Axapta 3.0 - October 2002
Microsoft Axapta Enterprise Portal, intercompany collaboration
New security and configuration keys
Expanded geographical reach (more countries)
Demand planning
Enhanced partner productivity tools
The above history is obtained from Partnersource. heres the link...
A Short History of DAX
Labels: General
Wonderful AX Demos available at this link
Its a absolute must see for all DAX folks
https://microsoftdynamicsax.demoservers.com/
Registration required (I've got mine and its kinda good, but a bit slow. You need a very good Internet connectivity. Good stuff though.)
Labels: General
The Architecture Journal brings together some of the best thinkers in the industry, and their articles have covered a variety of highly relevant topics for the software industry.
Its a must read for every Tech Savvy guy/gal :)
http://www.architecturejournal.net/
Its top level thought from some of the worlds greatest brains.
Labels: General
Microsoft Dynamics AX 4.0 Download
Dynamics AX 4.0
Microsoft Dynamics AX 4.0 Service Pack 1 release
Dynamics AX 4.0 SP1
{The above links require Partnersource Logon}
Labels: General
Aggreg8 is a social networking and collaboration space for the IT community. Inside you can keep track of your trusted network, find others through your network with similar interests or situations.
http://aggreg8.net/default.aspx
Definitely worth checking out.....
Labels: General
DAX system tables contain data that the DAX kernel uses to control the behavior of the kernel. DAX system tables are created automatically by the kernel when DAX is started for the first time against an empty database or after a service pack upgrade.
ACCESSRIGHTSLIST
This table contains info about explicit granted access rights for the defined user groups.
COMPANYDOMAINLIST
This table contains relation between companies and domains.
DATAAREA
This table contains data about created companies.
DATABASELOG
This table contains data about which tables and events to log. The events are logged in the DAX tableSysDatabaseLog.
DOMAININFO
This table contains data about domains.
PRINTJOBHEADER
This table is used in connection with printing from DAX.
PRINTJOBPAGES
This table is used in connection with printing from DAX.
SQLDESCRIBE
This table is used temporarily during check / synchronisation process and should normally be empty.
SQLDICTIONARY
This table contains data dictionary data about DAX application and system tables (except SQLstemVariables) as stored in DAX data dictionary.
SYSCONFIG
This table contains license information, version, feature key setup, and other basic system configuration data.
USERGROUPLIST
Table describes relation between users and user groups.
USERINFO
Table is used to store general setup.
{Please use them with utmost care}
Labels: X++
One of my clients wanted a solution where by he could notify/e mail employees/members/groups directly from PO & SO. So I came up with a small utility which allowed a user to notify directly from PO & So Forms via e mail.
Happy mailin :)
Labels: How To's
Temporary tables are used for non-persistent storage in Microsoft Axapta.
They are useful in two common situations
1. As the datasource for a form or report, where the original data is too complex to be easily queried.
2. As temporary storage during complicated processing, to hold the results midway through the process.
Scoping rules for temporary tables
In general, each instance of a temporary table, and it's associated data, will only exist while the buffer variable used to access it is in scope.
You can point multiple buffer variables to the same instance of a temporary table by using either the .setTmpData() method or by directly assigning the buffers to each other, identically to normal tables. In this way, even if your original buffer variable goes out of scope, your data will be retained while one of the other referencing variables remains.
Be aware that static table methods - such as find() - will not work with temporary tables unless you pass through the buffer variable to the method.
For example, this method will not work on a temporary table, as the tempTable variable used is newly created and will always contain no records.
public static TempTable find(AccountNum _accountNum, boolean _forUpdate = false)
{
TempTable tempTable;
;
if (_accountNum)
{
tempTable.selectForUpdate(_forUpdate);
select firstonly tempTable
where tempTable.AccountNum == _accountNum;
}
return tempTable;
}
If you want to have a find() method on your temporary table, then you will need to modify it slightly to pass through a reference to our populated temporary table.
public static TempTable find(AccountNum _accountNum, TempTable _tempTable, boolean _forUpdate = false)
{
if (_accountNum)
{
_tempTable.selectForUpdate(_forUpdate);
select firstonly _tempTable
where _tempTable.AccountNum == _accountNum;
}
return _tempTable;
}
Some examples of populating and using temporary tables can be found in project.
Creating temporary tables
In the AOT
Set the Temporary property to Yes to create a table which will always be temporary.
Note that any existing data will be permanently deleted if you do this!
Of course, you can no longer use the Table Browser to check the data, as the data is stored only per scoped instance of this table.
Making an existing table temporary
You can convert a normal table to a temporary table in code. For example, if you wish to create a temporary copy of the inventory table:
InventTable inventTable;
;
inventTable.setTmp();
Doing so will remove all data from the temporary copy of the table. If you wish to create a populated temporary copy of a standard table, you can do the following:
InventTable inventTable;
InventTable inventTableTmp;
;
inventTableTmp.setTmp();
while select inventTable
{
inventTableTmp.data(inventTable.data());
inventTableTmp.doInsert();
}
You can now add, modify or delete data from the table without affecting the real contents stored in the database.
Temporary tables in forms
Using temporary tables in forms requires the use of the .setTmpData() method.
For example:
The temporary table data is populated in a static class method (running server side), which is called from the form and returns the populated table. We could populate a form-level buffer with the temporary data if needed, or else just call the populating method directly from the setTmpData() call as shown below.
In the form datasource init(), we use .setTmpData() to instruct the datasource query to use our temporary table. Our datasource name in this example is TempTable.
public void init()
{
super();
TempTable.setTmpData(tmpTableClass::populateTmpData());
}
Temporary tables in reports
The correct method of using temporary tables in reports is slightly different from that of forms.
The most important difference is the use of .setRecord() instead of .setTmpData(). A simple example follows:
public boolean fetch()
{
boolean ret;
this.queryRun().setRecord(tmpTableClass::populateTmpData());
ret = super();
return ret;
}
As there is often already a supporting RunBaseReport class being used to run the report, it is easy to integrate the population of the temporary data into that existing class. This is particularly useful if you need the data in the temporary table to be dependent on information entered into the report dialog prompt by the user.
Labels: How To's
Recently I came across a situation in AX where I needed to capture a lot of Information in Journal Trans form for a specific journal type and while posting the Journal, those data needed to be updated in a separate table. So instead of working with the base Ledger Journal Types, I found it convenient to create a new Ledger Journal type. The objects used are shown below. In case further info is required, lemme know :)
In case u have a better idea, also lemme know :-D
Happy Journaling.....
You can also extend this model to create your own posting profiles [I'm recently workin on tat :) ]
Labels: X++
Hi , Its kinda simple to create a Checklist in X++ , just like the sysStartup Check List. Attaching the screenshot n objects used. In case anyone wants the XPO, lemme know.
Labels: X++
Recently i got an error when I installed DAX 3.0 SP5 on a fresh PC when it was compiling for the first time. The error screen is shown below. I downloaded the latest GridEX20.ocx from http://www.janusys.com/janus/beta/downloads_patches.htm
Replaced in the Client/Bin Folder . The error vanished :-)
An error log was generated in MyDocuments Folder :-(
Replace the GridEX20.ocx and enjoy :-)
Labels: Troubleshooting
With Web Deployment, the user executes, deploys, and installs the Microsoft Axapta client using Microsoft IE. The user can easily see if they need to install or update the client or if the client is ready to run. Web Deployment also allows you to use a central configuration for all Microsoft Axapta users, making it easy for you to change parameters without going to each client workstation. The Flowchart for this process is attached below. Last month I did this for one of my clients and came up with a jazzy web page. For more details, you can mail me...
Labels: How To's
In Microsoft Axapta 3.0, there are three cache mechanisms:
1. the single record cache,
2. the entire table cache, and
3. the record view cache.
Record Caching
The record cache is utilized for full key lookups only and contains the 100 most recently used records for a particular table. In a 3-tier environment, there is a record cache on the client and a record cache on the server. The server record cache is shared between all clients.
Record Cache are of the following types:
(a) NotInTTS
(b) Found
(c) FoundAndEmpty
Entire Table Caching
The entire table cache is a different type of caching compared to record caching,which is a complete local copy of a table. The entire table cache exists on the AOS, a 3-tier rich client, the COM connector, and on a 2-tier client. This
means that there is no entire table cache on a 3-tier thin client, as it utilizes the entire table cache located on the AOS.
The cache is populated at the time of the first access to that particular table for a given company.
Record View Caching
The RecordViewCache is instantiated using a X++ select with a where clause that defines the result set. The RecordViewCache is deactivated as soon as the RecordViewCache object goes out of scope or is destroyed.
It is private and offers a result-set cache with a limited lifetime.
Labels: How To's
Wanna find out where the error message comes from? Heres the secret.... Place a breakpoint in the class \Classes\Info\add(). After that run the script that shows error. You can observe where the error comes from in the DAX Debugger :-). See the following screenshots.......
Labels: Troubleshooting
What is TAPI
TAPI (Telephony Application Programming Interface) is a Microsoft Windows standard interface for integration between telephone systems and windows based software. A typical example is integrating called ID with a database on your computer that contains detailed information about potential callers. When your phone rings, a window pops up
on your computer with information about the caller. This is possible through software applications that are TAPI compliant and support the Screen Pop and Auto-Dialer capabilities.
Prerequisites
To be able to use the TAPI interface, you have to install a TAPI CT adapter. The adapter have to support the telephone you are using, and in many cases it would be preferred to buy the adapter from the same producer as your phone.When the adapter is procured, follow the instructions and install the TAPI driver on your computer.
Setting up the TAPI interface
Setting up the TAPI interface involves the following steps:
• Set up Microsoft Windows to handle your TAPI driver
• Select and set up TAPI in Axapta CRM.
Setting up Microsoft windows for TAPI adapter
1. From the Windows start menu, select Settings/Control panel. Open the Phone and Modem Options.
2. When standing in the Dialing rules tab, press the Edit button.
3. Fill in the Edit Location form, press Apply, and click OK when finished.
4. Click on the Advanced tab, and then click Add. The new device will then appear in the Add provider window. Select the driver you have installed for your TAPI adapter,and click Add.
5. A new window will now appear, and you must select which com-port to use.
6. Close the Phone and Modem Options.
Setting up Axapta CRM for TAPI adapter
1. Start Axapta and select CRM.
2. From the main menu select Sales force automation/Setup/Telephony/Phone parameters.
3. Delete all lines in the Phone parameters window, and shut down Axapta.
4. Restart Axapta and select Sales force automation/Setup/Telephony/Phone parameters from the main menu.
5. In the Phone parameters window select the line device provider you are using, click on the Set active line device button, and restart Axapta.
6. When restarted select the Sales force automation/Setup/Employee option. Select employee and go to the Telephony tab and check the Activate answer checkbox.This will make the telephone dialog pop on your screen each time you receive a call.
Labels: How To's
If you need to update a sales order or a purchase order without any user dialogs, Axapta provides you with a simple interface to do just that.The SalesFormLetter and PurchFormLetter classes contain the update method, which gives you an easy interface to setup and run posting of a sales order or a purchase order.
static void postSalesFormLetter(Args _args)
{
SalesFormLetter salesFormLetter;
salesTable salesTable;
ttsBegin;
while select salesTable
where salesTable.DocumentStatus == DocumentStatus::Invoice &&
salesTable.SalesId == 'SO/07/123' // Select the SO Number
{
salesFormLetter = SalesFormLetter::construct(DocumentStatus::Invoice); // Get a new instance of SalesFormletter
salesFormLetter.transDate(SystemDateGet()); // Set the invoicedate
salesFormLetter.update(salesTable, // SalesTable
SalesUpdate::All, // Quantity to update (SpecQty)
AccountOrder::None, // AccountOrder
false, // Proforma only?
true); // Printout?
}
ttsCommit;
}
Labels: X++
In order to create Global functions, create a new method in \Classes\Global Node. I have called mine Print Name.
{PLEASE BE CAREFUL}
\Classes\Global\PrintName
The Code in Print Name () is shown below
static str PrintName(Str FName,Str LName,Str MName="")
{
FName=StrDel(FName,2,STrLen(FName)-1);
If(MName)
MName=StrDel(MName,2,STrLen(MName)-1);
If(MName)
Return Fname+". "+Mname+". "+Lname;
else
Return Fname+". "+Lname;
}
And you've just created a global method :-)
Now Execute this job:
static void GlobalMethod(Args _args)
{
;
Info(PrintName("Arijit","Basu","Kumar"));
}
The Output:
Labels: X++
SysMailer mailer = new SysMailer();
SysEmailParameters parameters = SysEmailParameters::find();
mailer.fromAddress('arijitbasu@hotmail.com');
mailer.fromName('Pam@anderson.com');
mailer.subject('What are you doing tonite???');
if (parameters.DNSServerName)
{
mailer.DNSServers().add(parameters.DNSServerName,
parameters.DNSTCPIPRetryCount,
parameters.DNSUDPRetryCount);
}
if (parameters.SMTPRelayServerName)
{
mailer.SMTPRelayServers().add(parameters.SMTPRelayServerName,
parameters.SMTPPortNumber,
parameters.SMTPServerIPAddress,
parameters.SMTPUserName,
parameters.SMTPPassword);
}
// Add your own code here, then send the message
======================================================
SysMailer mailer = new SysMailer();
mailer.body("My Body :)");
mailer.subject("WOW Baby");
mailer.fromAddress("Pam@anderson.com");
mailer.fromName("Peter Villadsen");
mailer.tos().add("arijit.basu@gmail.com");
mailer.SMTPRelayServers().add("MyRelayServer");
mailer.sendMail();
======================================================
SysINetMail Mail=new SysINetMail() ;
Mail.sendMailAttach("Pam@anderson.com",
"jul@roberts.com,
"WOW",
"My Body Text ;-)",
false,
"Attachment Path");
All the Best :-)
Happy Mailin...
Labels: X++
The particular number sequence can be found by:
1. Click General Ledger, click Setup, click Parameters and then look on the Number Sequence Tab. The Number Sequence you will be looking for will be the Number Sequence for Journal.
2. Right-click in the Number Sequence Code column and select the Main Table.
3. In the Number Sequence Window, click the List Button and delete any lines out of the window to correct the issue.
Labels: Troubleshooting
InventDim inventDim;
InventSum inventSum;
InventQty inventQty;
;
while select sum(postedQty), sum(received), sum(deducted), sum(registered),
sum(picked), sum(reservPhysical)
from InventSum group by itemId
join InventDim
where inventSum.inventDimId == inventDim.inventDimId &&
inventSum.itemId == 'A001' &&
inventDim.inventLocationId == 'GW'
{
inventQty = inventSum.PostedQty+inventSum.Received+inventSum.Deducted-
inventSum.Picked-inventSum.ReservPhysical;
}
info(strfmt('%1', inventQty));
Labels: X++
static void createPurchase(Args _args)
{
AxPurchTable table;
AxPurchLine line;
;
table = new AxPurchTable();
table.OrderAccount('3023');
table.InventLocationId(‘WAREHOUSE’);
table.save();
line = new AxPurchLine();
line.axPurchTable(table);
line.itemId('A001'); // Item number Q987
line.purchQty(12); // 12 pcs.
line.save();
}
Labels: X++
Highlighting complete rows
The method .displayOption() method on a form datasource can be over-ridden to control the appearance of an single row in a grid. It is possible to set the background or foreground (text) colour.
public void displayOption(Common _record, FormRowDisplayOption _options)
{
_options.backColor(WinApi::RGB2int(255,255,0)); // Yellow
}
Highlighting individual grid cells
To highlight one or more individual cells, use the ._options.affectedElementsByControl() method to limit the effect to only the cells in which you are interested.
Note that while this method can display the same colour in multiple cells, there is no way to display different colours in a single row.
public void displayOption(Common _record, FormRowDisplayOption _options)
{
_options.backColor(WinApi::RGB2int(255,255,0)); // Yellow
_options.affectedElementsByControl(Control_Name.id());
_options.affectedElementsByControl(Another_Control_Name.id());
}
Labels: X++
static void Createquery(Args _args)
{
// This function will add a new Form to the AOT.
treeNode treeNode;
xInfo xInfo = new xInfo();
;
treeNode = xInfo.rootNode();
treeNode = treeNode::findNode("Forms");
treeNode.AOTadd("ArijitBasu");
treenode.AOTsave
}
Labels: X++
void clicked()
{
Args args = new args(); ;
Args.parm(Parameter.text());
switch (Parameter.text())
{ case '10001' : new MenuFunction(MenuItemDisplayStr(ParameterClass), MenuItemType::Display).run(args); break; case '10002' : //call appropriate menu item here break;
}
super();
}
Labels: X++
loginProperty loginProperty = new LoginProperty();
ODBCConnection odbcConnection;
Statement sql;
ResultSet result;
;
loginProperty.setDSN('dsnName');
loginProperty.setUsername('');
loginProperty.setPassword('');
odbcConnection = new ODBCConnection(loginProperty);
if (odbcConnection)
{
sql = odbcConnection.createStatement();
result = sql.executeQuery("select * from table");
while (result.next())
{
print result.getString(1);
}
}
Labels: X++