Friday, January 17, 2014

Total purchase invoice amount through X++

How to get a total invoice amount for a purchase order table, You had to take it in consideration for all the charges calculated (ex: tax). I tried to search the purchtable and purcline table for any existing methods. I found one class called purchtotals. there Microsoft calculating all the total amounts of incoice amount, order amount etc. Her...e is the code for this total calculation

PurchtotalsForm totalsForm;
;
totalsForm = PurchtotalsForm::newPurchTotalsForm(this, 1);
totalsForm.calctotals();
return totalsForm.invoiceAmountValue();

not only you can calculate invoice amount here is the list things you can get it from this class.

purchTaxTotal,
purchRoundOff,
purchTotalAmount,
purchTaxRoundOff,
purchCashDiscDate,
purchPrepayLimit,
purchPrepayAvailable,
purchTaxWithholdTotal

Friday, January 10, 2014

Import retail categories through code in dynamics ax 2012

Simple code to import Retail Product category

 EcoResCategory ecoResCategory
 ; 
 ecoResCategory.clear();
 ecoResCategory.initValue();
 ecoResCategory.initFromParent(EcoResCategory::findByName('HAL',ecoResCategory.CategoryHierarchy);
 ecoResCategory.Code = 'Test_categoryimport';
 ecoResCategory.Name = 'Test_Categoryimport';
 ecoResCategory.addToHierarchy();

import barcode through X++ in dynamics ax 2012

Some simple code for barcode import

 inventItemBarCode.barcodeSetupId = RetailInventTable::find(itemCode).BarcodeSetupId;
 inventItemBarCode.inventDimId = InventDim::findOrCreate(inventDim).inventDimId;
 inventItemBarCode.RetailVariantId = InventDimCombination::find(itemCode,inventItemBarCode.inventDimId).RetailVariantId;
 inventItemBarCode.itemId = itemCode;
 inventItemBarCode.description = InventTable::find(itemCode).defaultProductName();
 inventItemBarCode.UnitID = InventTable::find(itemCode).salesUnitId();
 inventItemBarCode.qty = qty;
 inventItemBarCode.useForInput = NoYes::Yes;
 inventItemBarCode.useForPrinting = NoYes::Yes;
 inventItemBarCode.itemBarCode = barcode;
 if(inventItemBarCode.validateWrite())
 inventItemBarCode.insert();

Partial sales order through code in Dynamics ax 2012 R2

I had been searching the internet to find the code. But i couldnt, every code leads to full invoice or line by line invoice. so i did some exploring to come up with a below code it will invoice partial quantity

I updated the partial sales invoice through code...

 SalesFormLetter salesFormLetter =  SalesFormLetter::construct(DocumentStatus::Invoice);
 SalesTable salesTAble;
 SalesParmLine parmLine;
 ;
 salesTable = SalesTable::find('FUAE-000002');
 salesFormLetter.salesTable(salesTAble);
 salesFormLetter.transDate (systemDateGet());
 salesFormLetter.specQty (SalesUpdate::All);
 //If you want proforma you can enable the code
 //salesFormLetter.proforma (true);
 //salesFormLetter.printFormLetter (true);
 salesFormLetter.createParmUpdateFromParmUpdateRecord(salesFormLetter.s alesParmUpdate());
 salesFormLetter.initParmSalesTable(salesTAble);

 salesFormLetter.initParameters(salesFormLetter.salesParmUpdate(),Printout::After);
 salesFormLetter.initLinesQuery();
 while select forUpdate parmLine where parmLine.ParmId == salesFormLetter.parmId()
 {
 ttsBegin;
 parmLine.DeliverNow = 10;
 parmLine.setQty(parmLine.salesParmTable().ordering, salesFormLetter.SalesParmUpdate().creditRemaining);
 parmLine.setInventDeliverNow();
 parmLine.setLineAmount(); 
 parmLine.update();
 ttsCommit;
 }
 salesFormLetter.run();

Monday, July 22, 2013

Exchange rate update add-on


Problem:
 
I was asked to create exchange rate add-on, It will update the exchange rate from online
  • This update add-on should have the ability to work automatically (without human intervention)
  • Given option to manual update also
  • Average update and Closing rate update for consolidation companies.
Solved: 
There is no inbuilt functionality for exchange rate updating in dynamics AX 2009. Following are the screenshots and functionality of the add-on that I created,
  • Configurable in batch job so that it automatically updates the exchange rate in exchange rate table. 
  • Based on the batch job, it will update the value in exchange rate table.
  • Notifications, errors and warnings will be updated in the log and shown to peoples.
  • Manual update option would be given to end user
  • Staging table : Its the mediator between actual exchange rate table and downloaded data from internet. It also can be viewable from the content pane 

 



If anybody need this add-on contact me on (mdashraf@live.in, india - 919043440941)
It is two hour development cost only

Following are the advantage of deploying this add-on to your company
  • It is automatic and highly customizable by end user
  • Easy deployment package
  • Enhancement can be made according to the customer (within the cost of this add-on)
  • support will be provided at free of cost
  • I am a freelancer so interested customer can contact me for apart from this development also

Saturday, July 20, 2013

ERD (Entity relationship diagrams) for dynamics ax tables


     Yesterday I read the news from Microsoft dynamics ax community forum that Microsoft has published ER diagrams for some dynamics ax tables. so I just want to share with you guys. It includes 30 database ERDs for tables in dynamics ax. Its very helpful for developer like us to finding the relations between tables when we are trying to customize. here I given the link go and enjoy

ERDs-  http://go.microsoft.com/fwlink/p/?linkid=296623

Microsoft dynamics ax interview questions part 3 - Senior technical consultant

         
           Before I am joining Wipro InfoTech I had attend lot of interviews and I got offer from some finest companies. I feel proud to join in Wipro. so here I am going to post my third series of dynamics questions but its senior level. get on
 
  • Name the two dynamics framework newly added on Ax 2012
  • Explain ledger framework in AX 2012
  • In AX 2012 journal postings are running on IL code. So how do you debug the posting
  • What are all the steps in Dynamics ax 2012 upgradation. in which level you worked extensively explain it.
  • Name the two newly added best practices in Dynamics ax 2012 on all the AOT objects
  • Explain the table inheritance in AX 2012 with examples
  • Consider the situation that huge number of invoices happening on the particular company. so Client wants you to modify something on the invoice place. so what are all the steps would you take to prevent fall of performance in the system
  • Have you worked on SSRS.
  • When user wants to open the SSRS report I want some user input for the report. What are all the steps to get user input. (here I explained about the controller classes and dialogs to get user inputs)
  • Ok I need a lookup in that SSRS dialog field. how do you achieve it. what are all the classes you use.
  • Explain the types of way to get Data sources in SSRS report
  • Explain the data methods in SSRS report. what is the purpose when did you use it
  • Explain post handler and pre handler in AX 2012
  • how do you get the exchange rate for transaction currency (here I explained about exchangeratehelper class)
  • Explain trade agreements and their use
  • Explain model and model store
  • say some scripts you used at the time of data migration
  • How do you migrate the changes from Development to UAT
  • What is inbound and outbound
  • Explain the steps for creating services in dynamics ax
  • Explain the real time steps for development (Interviewer asking about the series of real-time development lifecycle in dynamics ax. This actually a tricky question here you have to explain the document preparation and step by step development process from Requirment to TDD)