21 May 2012

WTF


19 April 2012

Add a single postal location to an ax 2012 form


To add a single postal address to a form with the new ActionPane there are several steps to do:

  1. Add the EDT LogisticsLocationRecId to the table where the new postalAddress should be added
  2. Add this table to the LogisticsLocationMap and create a Mapping: LogisticsLocationMap.Location ==  theNewTable.LogsticsLocationRecId
  3. Add the LogisticsPostalAddress Table to the Form

  4. Paste the following code to the form:

    public class FormRun extends ObjectRun
    {
        LogisticsPostalAddressFormHandler  addressController;
    }


    public void init()

    {
          super();
            addressController =
        LogisticsPostalAddressFormHandler::newParameters(newTable_ds, logisticsPostalAddress_ds);

              addressController.callerUpdateQuery(fieldNum(newTable, LogisticsLocationRecId));
          }

          public LogisticsPostalAddressFormHandler getAddressController()
          {   
              return addressController;
          }
        1. Place an ActionPane to your form with the MenuItemButtons New/Edit/Clear/Map.
          The easiest way to do this is to copy and paste it from the BankAccountTable form.

        2. Add this Code to the active method of the main DS:

          public int active()
          {
              int ret;

              ret = super();

              if (ret)
              {
                  addressController.callerActive();
                  addressController.callerUpdateButtons(newAddress, editAddress, clearAddress, mapButton);
              }

              return ret;
          }
        3. after that synchronize table and map and than try to open the form ;)




        11 April 2012

        Problems with ordering grid columns

        If there are problems with the ordering of grid columns of a grid inside a tab although the AllowUserSetup of the form is set to Yes. Check if the method tabChanged of the tab control is overwritten. Overwriting this method can cause problems with the re-ordering.
        Instead of using the TabChanged on the tab control move the code to the pageActivated method of the TabPage.

        23 March 2012

        Grouping data in SSRS

        To group data on a report you need the grouping pane. If it is not visible click grouping on the view tab.
        In the grouping pane right click a group an select add before or after to specify where to add the group. This group dialog opens:


        Set the name of the group in this dialog. After that the group expression can be specified. Just add grouping criterias. It is possible to group by data fields or by expressions.
        When closing the dialog a new grouping pane is added to the tablix data region. it contains a row or column where group values can be displayed.

        22 March 2012

        Fast way to refresh args caller datasource

        Cause I always forget these two lines of code to research the datasource of the calling args record in Dynamics AX. I will post it here so that I can google it every time I need it ;)


        FormDataSource   callerDataSource;
        ;


        if (_args != null
            && _args.record() != null)
        {
            callerDataSource = _args.record().dataSource();
            callerDataSource.research(true);
        }

        21 March 2012

        Adding an AX table as Dataset to an SSRS Report

        It is important to add the following code in the processReport Method of the DataProvider class in Dynamics AX to use a Table as a new Dataset in an SSRS Report:

        newTableNameTmp.setConnection(this.parmUserConnection());

        12 March 2012

        HTML Tags that can be used in SSRS

        To use HTML to format text in SSRS it is important to change the placeholder properties (right click on to the placeholder). In the placeholder properties change the markup type to HTML.


        After that it is possible to format text with HTML Tags. The following list of HTML Tags shows possible Tags that can be used in an SSRS control:
        • Hyperlinks: <A href>
        • Fonts: <FONT>
        • Header, style and block elements: <H{n}>, <DIV>, <SPAN>,<P>, <DIV>, <LI>, <HN>
        • Text format: <B>, <I>, <U>, <S>
        • List handling: <OL>, <UL>, <LI>
        For further information check out the following MSDN Page about Formatting Text and importing HTML.