Santosh.'s profileDynamics AxPhotosBlogLists Tools Help

Blog


    June 29

    How to reverse a packing slip updated Sales order/Purchase order in Dynamics Ax?

                                                

     

    Last week we had to work on AP module in order to solve a bug in Dynamics. So we had to do Packing slip on a created Purchase order, every time we had to create a new Purchase order & then do packing slip on it. Suddenly we realized why couldn't we do a reverse Packing slip and use the same purchase order instead of creating one. When searching we got one such link which explains, "How reverse Packing slip can be done"

     

     

    June 22

    AIF Update in Dynamics Ax

     

    Hi all,

    Yesterday night I was going through the site "Discussion in Axapta Programming.” There was a question regarding AIF (Application Integration Framework).


    The possibility to do updates of documents using AIF was introduced in SP2 (AX 4.0).

    Let me explain you in detail
    Suppose I want to use the AxdSalesOrder document to create new Sales Table entries and also to update existing sales Order, then 'update' action is used.

     

    How to perform update operation on AxD:

     

    v        Make sure that Axd<Table name> supports 'update' functionality.

    v        Configure AIF to update <AxD> in the system. [Refer Configuring AIF]

    v        Send (or) Create a valid transformed XML, so that the same could be used to 'update'.

    v Update any field value in the XML (i.e. <CustAccount>).

     
     <?xml version="1.0" encoding="utf-8" ?>
    - <Envelope xmlns="http://schemas.microsoft.com/dynamics/2006/02/documents/Message">
    - <Header>
      <MessageId>{FFF3E75E-A75C-4228-ABF0-8E3EA2483EE6}</MessageId>
      <SourceEndpointUser>Domain\UserName</SourceEndpointUser>
      <SourceEndpoint>EPDMO</SourceEndpoint>
      <DestinationEndpoint>LEDMO</DestinationEndpoint>
      <Action>createSalesOrder</Action>
      </Header>
    - <Body>
    - <SalesOrder xmlns="http://schemas.microsoft.com/dynamics/2006/02/documents/SalesOrder">
      <DocPurpose>Original</DocPurpose>
      <SenderId>dmo</SenderId>
    - <SalesTable class="entity">
      <CurrencyCode>USD</CurrencyCode>
    - <!-- Update Field -->
      <CustAccount>4004</CustAccount>
      <CustGroup>20</CustGroup>
      <DeliveryDate>2008-06-28</DeliveryDate>
      <InvoiceAccount>4014</InvoiceAccount>
      <LanguageId>en-us</LanguageId>
      <PurchOrderFormNum>Client PO Identifier</PurchOrderFormNum>
      <SalesID>00018_036</SalesID>
      <ShippingDateRequested>2008-05-01</ShippingDateRequested>
    - <SalesLine class="entity">
      <ItemId>B-R14</ItemId>
      <SalesQty>151</SalesQty>
      <SalesUnit>Pcs</SalesUnit>
      </SalesLine>
      </SalesTable>
      </SalesOrder>
      </Body>
      </Envelope>
    v Now make sure you override "allowUpdateUsingCreate" method to return 'true'  on the AxD Class.

    protected boolean allowUpdateUsingCreate()
    {
                   return true;

    }

    v Set 'update' to 'Yes' in our Axd<Table name> Query as shown below.

     img239/2724/64121747of7.jpg
     

    Note : Update should be set to 'Yes' for all the child datasource which are used in Axd query.

     

    Run the Inbound job and records will be updated as required.

    static void InboundProcessing(Args _args)

    {

         ;

         new AifGatewayReceiveService().run();

         new AifInboundProcessingService().run();

    }

     

    Now 'updating' any records in AX is easierSmile

    June 20

    SysContextMenu

     

    Hii......I'm back again with a new thing which I would like to share with you.

    Did any of you Guys tried customizing your own SysContextMenu in Dynamics Ax??? ...... Well I did one!!!..

    I was thinking as to how I can do some customizing work on SysContextMenu.So I came with an idea calling the Disk Cleanup from Ax using sysContextMenu. Please find the screenshot shown below.

     img146/5024/85927221mg3.jpg
     

    Simple Procedure as how to go about creating your own "SysContextMenu"

     

    v      Traverse AOT and find Menu

    v      Under Menu you find a submenu as SysContextMenu

    v      Right click on the same and create a Menu item

    v      Before you follow above steps, make a class/form and implement the code for the Add-in which you are going to provide in SysContextMenu.

    v      Drag the class/Form into Menu Item(Action/Display).

    v      Now link the created menu Item in SysContextMenu with MenuItemType & MenuItemName.

     

    YupppyAngel you got our own SysContextMenu I think you guys will feel pretty kewllllllll about this

    June 19

    How to insert a codeSnippet during runTime.

    Adding a piece of code of at runtime is now easier in AX and this could be achieved by using a Tree Node.

    Please refer the below example as to how a code can be inserted @ the runtime.

     

    static void InsertionofCodeSnippet(Args _args)

    {

        TreeNode    treeNode;

        int              i;

        str              actualCode;

        //Code that needs to be inserted.

        actualCode = @"int active()

    {

        int ret;

        ;

        ret = super();

        element.setBOMRouteEnabled();

        element.setRFIDEnabled();

        element.setItemDimEnabled();

        element.pbAsetEnabled();

        element.setFiscalLIFOEnabled();

        info(strfmt(inventTable.caption()));

        return ret;

    }"

        ;

        #AOT

        //Find the destination as to where it needs to be added

        treeNode = infolog.findNode('\\Forms\\InventTable\\Data Sources\\InventTable\\Methods\\active');

        //Set the source.

        treeNode.AOTsetSource(actualCode, false);

        treeNode = infolog.findNode('\\Forms\\InventTable');

        //Load it in the AOT

        treeNode.AOTload();

        treeNode.AOTsave();

        treeNode.AOTrefresh();

    }

     
     

    When is my Label file updated in AX?

    Please refer the below link.

    Dick Wenning has clearly explained how the label file is updated in AX

    Really interesting one to follow

    http://axstart.spaces.live.com/blog/cns!E82F2C8CB173C0A0!269.entry

     Happy Learning.

    X++ Compiler - Dynamics Ax

    Hi GuyzzzzzzRed heart

     

    I'm back. Sorry for not updating my blog from the last 3 months.... I was very busy with AX2009 development work.

    Anyways today i am going to explain how can we compile an object in AX with using the option from the SysContextMenu.

     

    i.e. User doesn't need to select the class and externally do a compile Forward on it.

    Various classes, which are available in AX for compiling objects, are as follows:

    SysCompilerOutput

    SysCompileForward

    SysCompileAll and so on.........................................

     

    Let me explain you with a simple Job in AX

    static void CompileForward (Args _args)

    {

                  // Any class, which is compileForward in AX, this class is responsible

                  // SysCompilerOutput extends the xCompileOutput (Which is the system class)           

                 SysCompilerOutput          sysCompilerOutput;

                 ;

                 // The return type of the sysCompilerOutput is the classId;

     

                 // "Class1” is the name of the class, which needs to be compiledForward           

                 sysCompilerOutput::compileForward(className2Id(identifierstr(class1)));

    }

    Similarly if you want any object to "compile" in AX. Try using the method "compile" from "SysCompileAll" class.

     

    Happy Learning............

    Your next doubts in AX is my new entry in X++ stuffs

    So keep doubtingggggWink