web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Implementing Jumpref or View Details on a List page

(0) ShareShare
ReportReport
Posted on by 11,310

Hi All.

I have the following scenario. I have added a display method based column to a list page in AX2012 that displays a purchase order Id. Due to the number of tables involved it seems unfeasible to do this via adding data sources to my form. However the problem that I experience is that although the display method returns a PurchId the List page does not provide a "view details" option. Furthermore I'm unaware of how to (if at all possible) create jump ref methods on a list page (I assume via ListPage interaction class).

If anyone has come across this issue or knows of a workaround please can you assist me,

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    Hello Jonathan,

    welcome back after a long time.

    well I think there are some chances to achieve this. I have not tested it yet, but let me share little idea so you may think of this direction

    first of all get the current record

    Common              currentRecord;

    currentRecord= this.listPage().activeRecord('CustTable');//'CustTable' is name of my DS

    Now get the form datasource name

    FormDataSource      frmDs

    frmDs   = currentRecord.dataSource();

    now using the form data source name we can make use of FormRun Object as under

    FormRun             formRun;

    formRun = frmDs.formRun();

    //now using form run, we can use FormStringontrol or FormRelaControl, depending upon what is type of control, where I am using display method lets suppose its string control

    FormStringControl   frmStringCtrl;

    frmStringCtrl.registerOverrideMethod(....

  • Verified answer
    Jonathan  Halland Profile Picture
    11,310 on at

    Hi Sohaib.

    Awesome thanks for that. It was just what I needed. After a bit of experimentation this is what worked...

    All done in the ListPageInteractionClass

    //declare in classDeclaration
    FormStringControl purchidCtrl;
    
    public void initialized()
    {
        Array fields;
        FormStringControl ctrl;
        FormDataSource      frmDs;
        Common              currentRecord;
        FormRun             formRun;
        
        super();    
        
        currentRecord= this.listPage().activeRecord('[MyDataSourceName]');
        frmDs   = currentRecord.dataSource();
        formRun = frmDs.formRun();
        purchidCtrl = formRun.control(formRun.controlId("purchId"));
        
        purchidCtrl.registerOverrideMethod(methodStr(FormStringControl, jumpRef),    methodStr([MyListPageInteractionClass], jumpRefPurch), this);
    }
    
    private void jumpRefPurch(FormControl _formControl)
    {
        PurchTable purch;
        Args            args;
        MenuFunction    menuFunction;
        ;
        
        if (purchid.valueStr() != "")
        {            
            menuFunction = new MenuFunction(menuitemDisplayStr("PurchTable"), MenuItemType::Display);
            args = new Args(menuFunction.object());
            purch = PurchTable::find(purchid.valueStr());        
            if (purch.RecId != 0)
            {            
                args.record(purch);
                menuFunction.run(args);
            }
            else
            {
                error(strFmt("Purchase order: %1 no longer exists"));
            }
        }
        
    }
    
  • Anand Agarwal Profile Picture
    45 on at

    It worked for me Thanks Man !!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans