Category Archives: Enterprise Portal

Enterprise Portal Development Videos

Enterprise Portal Development Series:

Videos at CustomerSource

Reference :
Leave a comment

Posted by on December 4, 2015 in AX 2012, Enterprise Portal, Uncategorized



Passing parameters from Modal dialog to calling page.

 Caller page:

    protected void Page_Load(object sender, EventArgs e)

AxBaseWebPart.GetWebpart(this).ModalDialogClosed += new EventHandler(Base_ModalDialogClosed);

/// This method will  be used to Returning the value ModalDialogClosed.
void Base_ModalDialogClosed(object sender, AXModalDialogClosedEventArgs e)
// Code to handle the returned value.
string returnValue;
returnValue = e.DialogArgs.Data;
QtyEdit.Text = returnValue;
if (returnValue != String.Empty && localRecId != String.Empty)
this.OrderListDS.GetDataSet().DataSetRun.AxaptaObjectAdapter.Call(“PurchLine”, returnValue, localRecId);
catch (Exception ex)
Proxy.Info objInfoLog = new Proxy.Info(this.AxSession.AxaptaAdapter);
objInfoLog.add(Proxy.Exception.Info, “Ordering list not selected”);

Modal Page :

On button click:
protected void SaveButton_Click(object sender, EventArgs e)
AXDialogArgs args = DialogHelper.DialogArgs;
args.Data = QtyEdit.Text;
//can use the below to refresh calling page.


Leave a comment

Posted by on October 9, 2015 in Enterprise Portal



Filter Invent On -Hand based on WMSLocation

Today I have faced a issue how to show or filter data on InventSum Grid in EP from WMSLocation i.e. for each location there should be Invent On-hand data.

Same as AX 2012 R3 rich client in EP.

For these following are the steps:

  1. Create a Dataset EPInventGridOnHand.
  2. Add InventSum and InventDim table in datasource of EPInventGridOnHand dataset.
  3. Now on init() method of EPInventGridOnHand dataset we will get WMSLocation buffer with InventLocationId and WmsLocationId field value and write below code before dataset Init method super()


wmsLocation = element.args().record(); // Here wmsLocation is a global table buffer

For filtering based on WMSLocation write below code after dataset init method super()

               //Filter Invent On-hand based on WMSlocation

inventDim_ds.query().dataSourceTable(tableNum(InventDim)).addRange(fieldnum(InventDim,wmsLocationId)) .                                   value(queryValue(wmsLocation.wMSLocationId));

inventDim_ds.query().dataSourceTable(tableNum(InventDim)).addRange(fieldnum(InventDim,InventLocationId)) .                                 value(queryValue(wmsLocation.inventLocationId));

              //This will group by Onhand based on Item

inventSum_ds.query().dataSourceTable(tableNum(Inventsum)).addGroupByField(fieldNum(Inventsum, ItemId));

             //This will add fields in InventSum run time with clubbing the values.


Arun Garg

1 Comment

Posted by on September 23, 2015 in AX 2012, Enterprise Portal


Tags: ,

Find axbound field on EP

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;

Leave a comment

Posted by on September 21, 2015 in AX 2012, Enterprise Portal



Get AX Data Set Current Row on EP

private DataSetViewRow CurrentRow
DataSetView dsv = this.dsImportRadioEquip.GetDataSet().DataSetViews[this.gvModel.DataMember];
return (dsv == null) ? null : dsv.GetCurrent();
// CurrentRow on the dataset throws exception in empty data scenarios
catch (System.Exception)
return null;

Leave a comment

Posted by on September 21, 2015 in AX 2012, Enterprise Portal


Tags: ,

Custom lookup on EP

To provide an ASP.Net text box to work as AX lookup field, need to follow following steps
1-Creae a new text box in page (Out of AXForm)
2-Add new ax lookup control from tool box
3-Set target control as added text box by using Lookup control’s target properly
4-If you want to show filtered data on the lookup then chose lookup types as CustomDataSet
5-To define lookup dataset use lookupControl’s Lookup event and set lookupDataSet by using following pattern code

protected void LookupFieldName_Lookup(object sender, AxLookupEventArgs e)
//Getcurrent user to filter record based on current user
String usr = WindowsIdentity.GetCurrent().Name;
int pos = usr.IndexOf(‘\\’);
usr = pos != -1 ? usr.Substring(pos + 1) : usr;
AxLookup lookup = (AxLookup)sender;

// Create the lookup data set. The respective table will be used.
Proxy.SysDataSetBuilder sysDataSetBuilder;
sysDataSetBuilder = Proxy.SysDataSetBuilder.constructLookupDataSet(AxSession.AxaptaAdapter,TableMetadata.TableNum(AxSession, “TableName”));

// Set the generated data set as the lookup data set.
lookup.LookupDataSet = new DataSet(AxSession, sysDataSetBuilder.toDataSet());
using (Proxy.Query query = lookup.LookupDataSet.DataSetViews[0].MasterDataSource.query())
query.dataSourceNo(1).addRange(TableArrayFieldMetadata.FieldNum(this.AxSession, “TableName”, “FieldName”)).value = “ValueInStringFormat”
//Example String.Format(“{0:dd/MM/yyyy}..{1}”, System.DateTime.Today, DateTime.MaxValue.ToShortDateString());


// Specify the fields for the lookup.
lookup.Fields.Add(AxBoundFieldFactory.Create(AxSession, lookup.LookupDataSetViewMetadata.ViewFields[“Field1”]));
lookup.Fields.Add(AxBoundFieldFactory.Create(AxSession, lookup.LookupDataSetViewMetadata.ViewFields[“Field2”]));
lookup.Fields.Add(AxBoundFieldFactory.Create(AxSession, lookup.LookupDataSetViewMetadata.ViewFields[“Field3”]));
lookup.Fields.Add(AxBoundFieldFactory.Create(AxSession, lookup.LookupDataSetViewMetadata.ViewFields[“Field4”]));
// Specify the select field for the lookup.
lookup.SelectField = “Index/LookupFieldName”;

Leave a comment

Posted by on September 21, 2015 in Enterprise Portal



Upload document through EP in AX

To provide document attachement feature on EP form to upload documents, need to follow below setps 

1-Add new datasource by using EPDocuInfoAdd data set from AX
2-Add new ASP:FileUpload control on page
3-On Ok/Submit button call below method after Inserting/Updating recordprivate void DocumentUpload()
DataSetView datasetViewAppl = DataSourceName.GetDataSourceView(AXFormControlName.DataMember).DataSetView;

DataSetViewRow docuRefAdd = this.dsDocuRef.GetDataSourceView(“DocuRef”).DataSetView.AddNew();
DataSetViewRow docuRefCurrent = this.dsDocuRef.GetDataSourceView(“DocuRef”).DataSetView.GetCurrent();

IAxaptaRecordAdapter docuRefRecord = docuRefCurrent.GetRecord();
docuRefRecord.SetField(“RefTableId”, (object)datasetViewAppl.GetCurrent().GetFieldValue(“TableId”));
docuRefRecord.SetField(“RefRecId”, (object)datasetViewAppl.GetCurrent().GetFieldValue(“RecId”));
docuRefRecord.SetField(“TypeId”, “File”);

string[] myFiles = Request.Files.AllKeys;
bool dataSaved = false;
if (FileUpload1.HasFile)
using (IAxaptaRecordAdapter irecDocuValue = ApplicationProxy.EPDocumentHandling.saveWebDocumentClient(
if (irecDocuValue != null)
// Get the RecId of the insert DocuValue record.
Int64 valueRecId = (Int64)irecDocuValue.GetField(“RecId”);

if (valueRecId != 0)
//Update the ValueRecId field of the DocuRef record with the RecId of the DocuValue record
docuRefRecord.SetField(“ValueRecId”, (object)valueRecId);

// Saves the DocuRef record in the DB.
ApplicationProxy.EP.createDocuRef(AxSession.AxaptaAdapter, docuRefRecord);

// Set this parameter to enable redirection.
dataSaved = true;
throw new System.Exception(“File upload error”);

Leave a comment

Posted by on September 21, 2015 in AX 2012, Enterprise Portal


Tags: ,

Nishant Rana's Weblog

Everything related to Microsoft .NET Technology


A practitioner's views on Dynamics 365 for Operations and Finance

Supreme X++

A blog about good and bad development in Microsoft Dynamics AX

Microsoft Dynamics 365

Pavan Kumar Garlapati

Microsoft Dynamics AX/365 Finance and Operations Development Blog

Technical blog about Dynamics AX 2012 and Dynamics 365 for finance and operations


Dynamics 365 Blog

vmoskalenko blog

SQL, AX, Windows, Azure

Syed Rafay Ali

This blog contains information about Functional techniques and guidelines in Microsoft Dynamics AX, including tips, tricks, tutorials, tools and upcoming news enhancement in Microsoft Dynamics Ax

All About Microsoft Dynamics

Microsoft Dynamics AX, Microsoft Dynamics 365 for Finance and Operations, D365, Retail, SQL

Anitha Eswaran - Dynamics Ax

Microsoft Dynamics Ax blog


AxaptaHut ax = new AxaptaHut();

All About Dynamics 365

Dynamics 365, D365, Implementor

Philippsen's Blog

Everyday findings in my world of .net and related stuff

Microsoft Dynamics AX

A great site


All things Blockchain, AI and IoT

Dynamics Ax

Technical Knowledge