Sunday, May 28, 2017

Get Caller Form name and caller name in AX Table,AX Class method ax 2012

//Get Caller Form name and caller name in AX Table method ax 2012
FormDataSource fds;
FormName fn;
FormRun     caller;
if (this.isFormDataSource())
{
    fds = this.dataSource() as FormDataSource;
    if (fds)
    {
        fn = fds.formRun().name();
 caller = fds.formRun().args().caller();
            if(caller.args().name() == formStr(<Form Name>))
            {
                //logic
            }
    }
}

2 comments:

  1. In which Table method we should use this code?

    ReplyDelete
  2. Any table method. I have checked in ModifiedField emthod

    ReplyDelete

Copy Markup charges while posting purchase invoice using X++

 Copy Markup charges while posting purchase invoice using X++ Class: Important: Code logic is just for Reference.  New class => Duplicate...