Tuesday, October 4, 2011

Get previous page selected record(context) in EP page in AX 2009

Hi All,

If you would like to get the previous page's selected record (Context) in EP in AX 2009 then you can use the following method in visual studio for it.

AxTableContext context = AxBaseWebPart.GetWebpart(this).ExternalContext;
if (context != null && context.TableId == TableMetadata.TableNum(AxBaseWebPart.GetWebpart(this).Session, "MainTable"))
             string TestField = context.DataKey.GetRecord(this.AxSession).GetField("TestField").ToString();

No comments: