My experience on Dynamics Ax 2012 EP Installation

Started working on Ax 2012, and recently installed the Enterprise portal (EP) in my system.

OS is Windows 7 Enterprise edition.

SharePoint Foundation 2010 can be downloaded from the following link.

http://www.microsoft.com/en-us/download/details.aspx?id=5970

I have downloaded the same, and tried the installation (by running .exe directly)… but have seen the following error.

Then, as a routine goggled for the issue, got the  following link….

http://msdn.microsoft.com/en-us/library/ee554869(office.14).aspx

By following the above link, successfully installed the SharePoint and completed the EP installation also.

Advertisements
Categories: Dynamics Ax 2012, EP 2012

Dimension (Field Value) Search Utility in Dynamics Ax

In recent days, I got a specific requirement…

At our place, finance controller has decided to close one dimension value and need to replace the same with new dimension value.

To support this, we need to update all the transactions which have old dimension value, to new one.

Assume all the transactions, which are created Dimension [10] – Business unit with value 201, need to update as 203

static void ininspar_Dimension201_Update_Alltables(Args _args)
{
    TreeNode                tn,fn;
    TreeNodeIterator        tni,fni,_tni;
    Str                     objName;
    SysDictField            sysDictField;
    Common                  common;
    Query                   query = new Query();
    QueryBuildDataSource    qbs;
    QueryBuildRange         qbr;
    TableId                 mTableId;
    QueryRun                qr;
    ;

    tn = TreeNode::findNode(“\\Data Dictionary\\Tables”);
    tni = tn.AOTiterator();
    tn = tni.next();

    while (tn)
    {
        objName = tn.treeNodeName();

        tn = tni.next();

        mTableId = tableName2id(objName);
        sysDictField = new SysDictField(mTableId, fieldname2id(mTableId, “Dimension”));  // Finding table object which have Dimension field

        if (sysDictField && Global::hasTableAccess(mTableId))
        {
            //info(objname);
            try
            {
                qbs = query.addDataSource(mTableId);
                qbr = qbs.addRange(fieldId2Ext(fieldname2id(mTableId, “Dimension”),10));   // using Dimension[10] in query range
                qbr.value(“201”);

                qr = new QueryRun(query);
                while (qr.next())
                {

                    common = qr.get(mTableId);
                    if (common.RecId)
                    {
                        common.selectForUpdate(true);
                        ttsbegin;
                        common.(fieldId2Ext(fieldname2id(mTableId, “Dimension”),10)) = “203”; //assigning the Dimension[10] value by using Common
                        common.update();
                        ttscommit;
                        info(strfmt(“%1 %2”,objName, int2str(common.RecId)));
                    }
                }
            }
            catch(Exception::Error)
            {
                continue;
            }

        }
    }
}

 

With this, we can write some Advanced Search utilities, to find specific values for some fields for the tables.

Categories: DynamicsAx Utilities

AIF – Update – The parameter index is not valid

October 4, 2011 2 comments

In recent days, working on AIF – Update action, and find one strange error as mentioned below.

Error: The parameter index is not valid.

Trying to solve the same, and then have checked on the parameter schema, it was defined as follows…

So realized, we need to submit two XML’s for the update scenario, or combination of these two required and then tried in the following way…

<Envelope xmlns=”http://schemas.microsoft.com/dynamics/2008/01/documents/Message”>

<Header><MessageId>{FDA1E99A-3519-458D-6DE7-8A4502322BF1}</MessageId><SourceEndpointUser>domain\aliasId</SourceEndpointUser>
<SourceEndpoint>DimensionsInbound</SourceEndpoint>

<DestinationEndpoint>USEndpoint</DestinationEndpoint>

<Action>http://schemas.microsoft.com/dynamics/2008/01

/services/Tel_DimensionsService/update</Action></Header>

<Body>

<MessageParts xmlns=”http://schemas.microsoft.com/dynamics/2008/01/documents/Message“>

<EntityKeyList xmlns=”http://schemas.microsoft.com/dynamics/2006/02/documents/EntityKeyList“>
<EntityKey xmlns=”http://schemas.microsoft.com/dynamics/2006/02/documents/EntityKey“>
<KeyData>
<KeyField>
  <Field>DimensionCode</Field>
  <Value>Department</Value>
</KeyField>
<KeyField>
<Field>Num</Field>
  <Value>2030</Value>
</KeyField>
</KeyData>
</EntityKey>
</EntityKeyList>
<Tel_Dimensions xmlns=”http://schemas.microsoft.com/dynamics/2008/01/documents/Tel_Dimensions“>

<Dimension>
<_DocumentHash>820acb9d4e266e791f5069edd7bd3d39</_DocumentHash>
<Closed>No</Closed><CompanyGroup>12345</CompanyGroup><Description>IN Global Support India – TEST123456</Description>
<DimensionCode>Department</DimensionCode>
<Num>2030</Num></Dimension></Tel_Dimensions></MessageParts>

</Body></Envelope>

Categories: Dynamics Ax

AIF File System Common Error

After 2 years, again, started working on AIF related project.

Want to share one important message w.r.t File system Adapter.

Long time back, have shared one article for the common error in File system adapter,

http://community.dynamics.com/product/ax/axtechnical/b/axsantoshkumar/archive/2008/07/30/dynamics-ax-aif-file-system-adapter-inbound-common-error.aspx

Common Error: Cannot be read because the submitting user could not be determined. The default owner for objects created by members of the Administrators group must be set to the object creator.

 Above article is, w.r.t windows 2003 server, whereas windows 2008 and other advanced server don’t support this functionality.

Instead of changing folder properties and all, we can achieve the same through our Ax…

Assume that on the Endpoint (AIF – Setup) we have, defined the following user…

Take the SID from UserInfo table for the above user, and assign the same as shown in following picture.

\Classes\AifFileSystemReceiveAdapter\readFile

Categories: Dynamics Ax

Redirecting to the pages using Action Menu Items.

In this example, want to illustrate, how we can use an Action Menu Item, to re-direct to the EP pages of Ax.

Have a look into the following picture.

Have placed the Image button, beside the Project Id.

On the click event of the Image button, calling Ax action menuitem and in the related action menu item class, redirecting to the details page by passing the required arguments.

The following code from the C# web part, click event of Image button.

protected void ImageButton_Click(object sender, EventArgs e)
{
 //The following lines for, to get the index of the selected row on the grid.
   ImageButton imageeButton = (ImageButton)sender;
   GridViewRow row = (GridViewRow)imageeButton.NamingContainer;
   AxGridViewTimesheet.SelectedIndex = row.DataItemIndex;      
   DataSetViewRow dsvr;
   //Creating object for Action menu item
   AxActionMenuItem projMenuItem = new AxActionMenuItem("PMProjTimesheetView");
   Proxy.Args args = new Proxy.Args(this.AxSession.AxaptaAdapter);
   //Get the current record
   dsvr = 
   this.AxDataSourceProjListTmp.GetDataSet().DataSetViews["ProjTable"].GetCurrent();
   IAxaptaRecordAdapter projTable = dsvr.GetRecord();
   
   //Passing the record to the action menu item class
   args.record = projTable;
   projMenuItem.Run(args);
}

The following code from the Ax action menu item related class (PMProjTimesheetView)

static void main(Args args)
{
    ProjTable           projTable;
    Weblink             link;
      ;
    if (args.dataset() == tablenum(ProjTable))
    {
        projTable = args.record();
        link = new Weblink();
        link.record(projTable);
        link.menufunction(new WebUrlMenuFunction(weburlitemstr(EPProjTableInfo)));
        webSession().redirect(link);
    }
}
Categories: Dynamics Ax, EP

Hover Text in our Dynamics Ax EP Page

January 1, 2011 2 comments

Happy and Prosperous New Year – 2011.

In this article, I want to share the example like, 

Displaying Hover text or Popup window with a text, will be displayed in our EP pages of Dynamics Ax. 

Assume that, we need to place the memo fields like Address/Notes/Comments fields on the grid, in this case these fields will take much space on the Grid. Page size is also more. 

For this scenario, the following example helps us to decrease in the size of the Grid and value will be displayed as Hover text. 

In this example, I am displaying the Hover text for the Customer Address, 

On the AxGridView,

1)      Converted the Address field to ASP Template fields. (Template text field)

2)     Defined the JavaScript functions for Mouse Over and Mouse Out.

Code: 

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="SampleExample.ascx.cs" Inherits="SampleExample" %>
<%@ Register Assembly="Microsoft.Dynamics.Framework.Portal, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
 Namespace="Microsoft.Dynamics.Framework.Portal.UI.WebControls" TagPrefix="dynamics" %>
<dynamics:AxDataSource ID="DSSampleExample" runat="server"
    DataSetName="CustomerList" ProviderView="CustTable">
</dynamics:AxDataSource>
<script type="text/javascript" language="javascript">
var div = null;
var addname = "NoAddress";
function initDocu()
{
   div = document.createElement('div');
   div.id = 'divPopup'; 
   div.style.visibility = 'hidden'; 
   div.style.position = 'absolute'; 
   div.style.top = '0'; 
   div.style.left = '0'; 
   document.body.appendChild(div);
}
function ShowPopup(hoveritem) 
{ 
   initDocu();

   var address = document.getElementById(hoveritem.id);
   addname = address.value;

    if (addname)
    {
        hp = div; 
        hp.style.top =  event.clientY;
        hp.style.left = event.clientX;
        hp.style.visibility = "visible";
        var html = '<table bgcolor="#666666">'; 
        html += '<tr><td bgcolor="#FFFFE1">'; 
        html += addname
        html += '</td></tr></table>';
        hp.innerHTML = html;
    }
    else
    {
        HidePopup();
   }
} 
function HidePopup() 
{ 
  hp = div; 
  hp.style.visibility = "hidden";
}
</script>
<dynamics:AxGridView ID="AxGridSampleExample" runat="server"
    DataKeyNames="RecId,ContactPerson!RecId" DataMember="CustTable"
    DataSourceID="DSSampleExample" >
    <Columns>
        <dynamics:AxBoundField DataField="AccountNum" DataSet="CustomerList"
            DataSetView="CustTable" SortExpression="AccountNum">
        </dynamics:AxBoundField>
        <dynamics:AxBoundField DataField="Name" DataSet="CustomerList"
            DataSetView="CustTable" SortExpression="Name">
        </dynamics:AxBoundField>
        <dynamics:AxBoundField DataField="InvoiceAccount" DataSet="CustomerList"
            DataSetView="CustTable" SortExpression="InvoiceAccount">
        </dynamics:AxBoundField>
        <dynamics:AxBoundField DataField="CustGroup" DataSet="CustomerList"
            DataSetView="CustTable" SortExpression="CustGroup">          
        </dynamics:AxBoundField>
        <dynamics:AxBoundField DataField="PaymTermId" DataSet="CustomerList"
            DataSetView="CustTable" SortExpression="PaymTermId" >
        </dynamics:AxBoundField>
        <asp:TemplateField ConvertEmptyStringToNull="False" 
            HeaderText="<%$ AxLabel:@SYS9362 %>" SortExpression="Address" >
            <ItemTemplate>
                <asp:TextBox ID="TextBox1" runat="server"  
                    Text='<%# Bind("Address") %>' 
                    onmouseover="ShowPopup(this);" 
                    onmouseout="HidePopup();" ReadOnly="true">
            </asp:TextBox>        </ItemTemplate>
        </asp:TemplateField>
    </Columns>
</dynamics:AxGridView>  

Now the page looks like as follows….

 


Categories: Dynamics Ax, EP

Display Company Logo on Dynamics EP Site and Hide Page Title

December 10, 2010 2 comments

In this example, I want to share the things like

1)      Display the Company logo, on the EP site.

2)      Hide the Page title, the one which is there, to the side of the Company logo. 

To do the above things, go to the following path in the sharepoint server..

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\FEATURES\DynamicsAxEnterprisePortal

Select the filefor Editing in the Visual Studio…

In that file locate the Tag with the Id “GlobalTitleAreaImage”, and add the following Blue marked attributes to that Tag, as shown in below.

 LogoImageUrl is for displaying the image/company logo on the EP page.

  style=”display:none” for hiding the page title. 

 <td id=”GlobalTitleAreaImage”>
 <SharePoint:SiteLogoImage id=”onetidHeadbnnr0″ 
   LogoImageUrl=”_layouts/ep/images/Dynamics_Logo.bmp” runat=”server”/></td>
   <td width=100% style=”display:none”>
       <asp:ContentPlaceHolder id=”PlaceHolderSiteName” runat=”server”>
           <h1>
              <SharePoint:SPLinkButton runat=”server” NavigateUrl=”~site/” id=”onetidProjectPropertyTitle” >
              <SharePoint:ProjectProperty Property=”Title” runat=”server” />
              </SharePoint:SPLinkButton>
           </h1>
       </asp:ContentPlaceHolder>
    </td>

Save the file and do the IISReset. Now refresh the same page and see the result as follows…

 

Categories: Dynamics Ax