Posts

Showing posts from February, 2014

Getting Approver Information from Workflow - Dynamics AX 2012

Task to get the last approver of the workflow. Job gives the output as name of the approver of the required ID of the workflow static void workflowApproverInfo(Args _args) {     WorkflowTrackingStatusTable  workflowtrackingstatustable;     WorkflowTrackingTable        workflowtrackingtable;          while select workflowtrackingstatustable         order by RecId desc     join workflowtrackingtable         where workflowtrackingstatustable.ContextRecId == 5637155826 //(Required Record)            && workflowtrackingtable.TrackingContext == workflowtrackingcontext::WorkItem            && workflowtrackingtable.TrackingType == workflowtrackingtype::Approval            && workflowtrackingtable.WorkflowTrackingStatusTable == workflowtrackingstatustable .recid     {              info(workflowtrackingtable.User);              info(HcmWorker::find(DirPersonUser::findUserWorkerReference(workflowtrackingtable.User)).name());     } }

Connecting Visual Studio with a different Config File - Visual Studio 2010 and Dynamics AX 2012

Image
Visual studio must be installed on that machine. Live/Test configuration file must be saved on that machine. Steps: 1. Launch cmd 2. Navigate to the dir where VS is installed. In my case it is : Chdir  C:\Program Files\Microsoft Visual Studio     9.0\Common7\IDE\ 3.   Enter the command:  devenv.exe /AxConfig "enter here the live/test client config path"      eg. devenv.exe /AxConfig "C:\AX CONFIG\Live cus.axc" Go to View in Visual studio, click Application explorer. This would show the entire Test/Live AOT. You can then edit any report you would like. Screen shot as follows of the command prompt

Console Application to test Class Library code - AIF File Transformation

Console application code as follows static void Main(string[] args)          {              Stream input, output;              input = File.Open(@"C:\TEMP\ASN.xml", FileMode.Open);              output = File.Open(@"C:\TEMP\ASN_Output.xml", FileMode.Create);              StreamReader reader = new StreamReader(input);                                //string contents = reader.ReadToEnd();                          using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("AsnTransform.AsnStylesheet.xslt"))              {                  XPathDocument document = new XPathDocument(input);                  XPathDocument stylesheet = new XPathDocument(stream);                  XslCompiledTransform transform = new XslCompiledTransform();                  transform.Load(stylesheet);                  XmlWriterSettings settings = new XmlWriterSettings                  {                      OmitXmlDeclaration = false,    

AIF Transformation of Sales Order and ASN - Custom Code in Class Library

Image
We used the following code to meet specific requirements of transformation. 1- Sales Order Transformation using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml; using System.IO; using Microsoft.Dynamics.IntegrationFramework.Transform; namespace SalesOrderTransform {     public class Class1:ITransform     {         public void Transform(System.IO.Stream input, System.IO.Stream output, string config)         {             StreamReader sreader = new StreamReader(input);             XmlTextWriter xwriter = new XmlTextWriter(output, Encoding.UTF8);             string tagName = "SalesOrder";             string inputXml = sreader.ReadToEnd();             xwriter.WriteStartElement(tagName);             xwriter.WriteString(inputXml);             sreader.Close();             xwriter.WriteEndElement();             xwriter.Close();         }          } } 2- ASN Transformation namespace As

Job to Test AIF Services - Debug AIF

We can debug and test AIF Services via this job code manually. static void JobTest(Args _args) {     AifOutboundProcessingService    service;     AifGatewaySendService   send;     service = new AifOutboundProcessingService();     send = new AifGatewaySendService();     service.run();     //send.run();     //service.run(); }

AOS Restarting issue - Every time when a record is updated Inline

First we drilled down to the location where it was happening - Look into the form where the issue was reproduced. - Personalized and check the data structure involved in it. - Checked if any customization was done on those tables - When reverting the changes and compiling it, the issue of AOS Restarting got resolved.

AIF Issue with Transformation - Object Reference not set to an instance of an object

We encountered problem with the transformation of ASN and Sales Order invoice when moved to R2 from RTM. The basic issue identified was with the referenced version of Microsoft.Dynamics.IntegrationFramework DLL There were some identified version changes in RTM and and R2. So we build the solution again with the new referrenced DLL and it worked for one transformation of Sales order. Another Issue - We have an XSLT file to be accessed in the transformation code as follows. - It was embedded in the code and DLL was accessing it like this The solution was to place the file in System32 Folder of XSLT and code the following.  Stream inputXML = File.Open(@"AsnTransform.AsnStylesheet.xslt", FileMode.Open);   // Reads file from System32 folder  if (inputXML != null) {     //Code here }

Full Screen on Remote Desktop - RDP

Often we need to work on remote machines and when minimized, it drops to the maximum screen Press CTRL+ALT+BREAK to enter to Full Screen Again

SSRS Reports Deployment - Dynamics AX 2012 via Command Prompt

We can use this command Publish - AXReport - ReportName CustTransList, CustTransOpenPerDate For All the Reports Publish - AXReport –ReportName *