default code used in Ep

I)                   DLL

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

using Microsoft.Dynamics.Framework.Portal.UI.WebControls;

using Microsoft.Dynamics.Framework.Portal.UI.WebControls.WebParts;

using Proxy = Microsoft.Dynamics.Framework.BusinessConnector.Proxy;

using Microsoft.Dynamics.Framework.BusinessConnector.Session;

using Microsoft.Dynamics.Framework.BusinessConnector.Adapter;

using Microsoft.Dynamics.AX.Framework.Services.Client;

using Microsoft.Dynamics.Framework.Portal.UI;

using Microsoft.Dynamics.AX.Framework.Portal.Data;

//using ApplicationProxy = Microsoft.Dynamics.Portal.Application.Proxy;

using Microsoft.Dynamics.Framework.Portal;

II)                To get ax session ids:

private ISession AxSession

{

get

{

AxBaseWebPart webpart = AxBaseWebPart.GetWebpart(this);

return webpart == null ? null : webpart.Session;

 

}

}

III )  To get field value

#region Other functions

static AxBoundField GetField(DataControlFieldCollection fields, string name)

{

foreach (DataControlField field in fields)

{

AxBoundField boundField = field as AxBoundField;

if (boundField != null && String.Compare(boundField.DataField, name, true) == 0)

return boundField;

}

return null;

}

#endregion

Example :

AxBoundField StartDate = (AxBoundField)GetField(this.AxGroup1.Fields, “StartDate”);

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s