Code for Proxies in Enterprise portal of Axapta
If you would like to use your table methods or X++ classes or Enums in managed code, you should add them to proxies file under AOT\Web\Web Files\Static Files\Proxies. Typically Proxies are used if you need to access or update data that’s outside of Dataset or you would like to reuses some business logic in both Client and EP.
/table:EmplTable
/method:EmplTable.find
/enum:TrvExpType
/class:EPTrvItemization
/method:EPTrvItemization.insertItemizedLines
After changing the Proxies file, you can generate the proxies file using Tools->Development Tools -> Development Tools-> Web Development -> ProxiesOr by clicking the Update button in Manage deployment UI.
Create the complete URL in code (based Oneb Menu Items)
protected override void OnPreRender(EventArgs e)
{
// Gets the current view to the record selected in the dropdown
DataSetView view = dsSales.GetDataSourceView(ddSales.DataMember).DataSetView;
DataSetViewRow row = view.GetCurrent();
// Get the url for the webpage that referenced the current record
// In the sample an extra method was made for this
AxUrlMenuItem url = new AxUrlMenuItem("EPSalesTableInfo");
// Set the record context on the URL so we can open the pge for a specific record
DataSourceMetadata metaData = this.dsSales.Metadata.DataSources[ddSales.DataMember];
AxTableContext context = AxTableContext.Create(row.GetDefaultTableDataKey(metaData));
url.MenuItemContext = context;
// update the hyperlink to point to the url
hpRecord.NavigateUrl = url.Url.ToString();
base.OnPreRender(e);
}