| Santosh.'s profileDynamics AxPhotosBlogLists | Help |
|
May 25 Inside Microsoft Dynamics AX 2009 - Released
A big Thanks to MFP and Arjit for their contribution on the release of latest edition on "Inside Microsoft Dynamics AX 2009". To Download Code Samples: http://www.microsoft.com/learning/en/us/book.aspx?ID=13345&locale=en-us#tab2 Happy DAx Learning................................. May 22 SalesTaxGroup Defaulting Issue in AIF 2009I have seen a strange behaviour in AX 2009. While processing vendor records via AIF the corresponding sales tax group doesn't default in the vendor master. VendGroup master table has default tax group setup done as shown When “Vend Group” is passed via Xml accordingly the related fields needs to get defaulted. Screenshot on the same is shown.
Reason: There is no defaulting logic implemented in the setTaxGroup () method in the AxVendTable class. Solution: The setTaxGroup () method needs to implemented with the following logic after isMethodExecuted called. The setTaxGroup () method needs to implemented with the following logic after isMethodExecuted called. //Checks if VendGroup is provided in Xml. //If no VendGroup then it throws error stating mandatory field missing. this.setVendGroupFields ();
//Checks if <VendGroup> field is set in the Xml //And check if the vendor group master has TaxGroupId defined for it. If (this.isFieldSet (fieldnum (VendTable, VendGroup)) && this.vendGroupRecord ().TaxGroupId) { this.parmTaxGroup (this.vendGroupRecord ().TaxGroupId); }
With the following piece of code the sales tax group will be defaulted in the vendor master details. Even Customer master has similar issue and i assume Microsoft would either release a hot fix for AX2009/resolve the bug in vNext May 18 Editor Scripts - New AddinsI have developed few interesting add-ins for Dynamics AX as a part of my project requirement. This tool would be useful especially for AX Developers. The tool is basically an extension in the Editor scripts class. ShowSysFuntions: It is used to show details of sysFunction in Microsoft Dynamics AX. In order to know significance of a particular function the developer needs to traverse through SysDocumentation\Functions each time. Functions help is displayed in a help browser just like the in-built functions in Dynamics AX.
SysFunction Sneak Peak Video:
The second Editor Script is using the SysDictClass methods a) Extend b) Extended By
The project can be
Happy AX Scripting
May 12 Microsoft Dynamics AX 2009 Enterprise Portal DeploymentThanks to Mey for providing an opportunity to join an administrator oriented Deployment and Setup discussion on Enterprise Portal for Microsoft Dynamics AX 2009.
In his own words
"This session provides deep insight into the EP deployment process, what goes behind the scene for EP Setup program and some key "how-to" points on deploying and setting up EP, understanding the infrastructure, etc." Screencast is posted on
Webinar: http://channel9.msdn.com/posts/meysun/Microsoft-Dynamics-AX-2009-Enterprise-Portal-Deployment/
Presentation[PPT]: http://blogs.msdn.com/solutions/attachment/9584167.ashx
May 11 Generating XML for Excel import - via Definition Group
As a business partner you may require different ways of sending records as xML outside AX. Here is one such customization, which was done in the Excel Definition group to outbound an xML when record is inserted into the table.
We have used the existing logic present in AIF to publish the records when Excel records are imported through Definition group. Please find the detailed procedure on the same.
1) Create new Definition group <<Eg. COA>> of type “Excel” 2) Specify the Default file name from where the excel records needs to be imported. 3) Click on Table setup and specify the name of table for which it needs to import. <<Here i have choosen "LedgerTable" to import records.>> 4) Set the "Import Status" to "Import" 5) Specify the path from the where the excel need to pick the file. Link: http://cid-264a0056cbcbb1d3.skydrive.live.com/self.aspx/.Public/Tst.xls Here you can find the sample Excel file which i have created for my customization. 6) Under Import criteria of the Table setup form. Logic which was implement in Ledger Table in order to support outbound operation when excel import is performed is shown below. Before Excel import is perform make sure that basic AIF setup is done for DynamicsAX 2009. Later you'll observe a record in the queue Manager. Just run the AIF Inbound job and record will be sent out.
Hurray
May 07 Create and Post Free Text Invoice in AXHere is a sample class which is called via Dialog framework to create & post free text invoice using X++ code.
Job:
public void xtest() dialog = new Dialog("Free-Text Invoice");
if(dialog.run()) { if(dlgCustAcc.value() && dlgLedgerAcc.value() != '') FreeTxtInvoiceCreatePost::main(dlgCustAcc.value(), dlgLedgerAcc.value()); else throw error(strfmt("Either CustAccount or LedgerAccount info is missing.")); } } /// <summary> /// The <c>Job_FreeTxtInvoice</c> class is implemented to create/post <c>Free Text Invoice</c>. /// </summary> class FreeTxtInvoiceCreatePost { } static void main(CustAccount _custAccount, LedgerAccount _ledgerAccount) { CustInvoiceTable custInvoiceTable; CustInvoiceLine custInvoiceLine; CustTable custTable; LedgerTable ledgerTable; CustPostInvoice custPostInvoice; LineNum lineNum; int i; ;
/// <summary> /// The <c>CustInvoiceTable</c> logic is implemented to create single <c>Header</c>. /// </summary> ttsbegin; custTable = CustTable::find(_custAccount); custInvoiceTable.initFromCustTable(custTable); custInvoiceTable.insert(); ttscommit;
/// <summary> /// The <c>CustInvoiceLine</c> logic is implemented to create multiple <c>Invoice Lines</c>. /// </summary> for(i=1; i<=100; i++) { ttsbegin; ledgerTable = LedgerTable::find(_ledgerAccount); custInvoiceLine.clear(); custInvoiceLine.initValue(); custInvoiceLine.LedgerAccount = ledgerTable.AccountNum; custInvoiceLine.initFromCustInvoiceTable(custInvoiceTable); custInvoiceLine.AmountCur = 10.00; custInvoiceLine.Description = 'FreeTxIv' + int2str(i); custInvoiceLine.ParentRecId = custInvoiceTable.RecId;
//LINE NUM LOGIC. if(!lineNum) { lineNum = CustInvoiceLine::lastLineNum(custInvoiceLine.ParentRecId); }
lineNum += 1; custInvoiceLine.LineNum = lineNum; custInvoiceLine.insert(); ttscommit; }
/// <summary> /// The <c>custPostInvoice</c> class is called for posting <c>Free-TextInvoice.</c> records. /// </summary> custPostInvoice = new CustPostInvoice(custInvoiceTable); custPostInvoice.run(); }
You can even just play around with RunBase framework to invoke the dialog and pack/unpack the values. Try to check the example 'LedgerPeriodCreateFiscalYear' class.
May 02 Posting Issue in FreeText Invoice with same Item sales tax group on AX2009.When free text invoice is created via AIF with the same “Item sales tax group” and later try to post the free text invoice the following error message is encountered….
Sample xML:
<? xml version="1.0" encoding="utf-8"?> <CustInvoice xmlns="http://schemas.microsoft.com/dynamics/2008/01/documents/CustInvoice"> <CustInvoiceTable class="entity"> <CurrencyCode>USD</CurrencyCode> <InvoiceAccount>4000</InvoiceAccount> <InvoiceDate>2009-02-16</InvoiceDate> <OrderAccount>4000</OrderAccount> <CustInvoiceLine class="entity"> <AmountCur>100</AmountCur> <Description>Line 1</Description> <LedgerAccount>11005</LedgerAccount> <TaxItemGroup>full</TaxItemGroup> </CustInvoiceLine> <CustInvoiceLine class="entity"> <AmountCur>200</AmountCur> <Description>Line 2</Description> <LedgerAccount>11010</LedgerAccount> <TaxItemGroup>full</TaxItemGroup> </CustInvoiceLine> </CustInvoiceTable> </CustInvoice>
These error is observed because the Line num is never incremented and is always zero for all invoice lines.
Screenshot showing the LineNum à 0
The solution provided to fix the issue is similar to the logic implemented in AxSalesLine class , SalesLine table.
Changes which needs to be incorporated are….
\Data Dictionary\Tables\CustInvoiceLine: Create new method: static LineNum lastLineNum (CustInvoiceTableRefRecId custInvoiceTableRefRecId) { return (select maxof (LineNum) from CustInvoiceLine index hint ParentRecIdIdx where CustInvoiceLine.ParentRecId == custInvoiceTableRefRecId).LineNum; }
Classes\ AxCustInvoiceLine ClassDeclaration: Initialize the EDT LineNum
SetlineNum: Add the following logic this.setParentRecId (); if (this.isFieldSet(fieldnum(CustInvoiceLine, ParentRecId))) { if(!lineNum) { lineNum = CustInvoiceLine::lastLineNum (this.parmParentRecId()); } lineNum += 1; this.parmLineNum (lineNum);
Over-ride the end method () in the AxCustInvoiceLine. After super () call initialize the lineNum = 0. Now try posting the free text invoice which was created via AIF. With the follwing code the LineNum is incremented as a result the free text invoice is posted successfully.
Hope this article is useful
|
|
|