Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Answered

Implementing Jumpref or View Details on a List page

Posted on by 11,302

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,

  • Anand Agarwal Profile Picture
    Anand Agarwal 45 on at
    RE: Implementing Jumpref or View Details on a List page

    It worked for me Thanks Man !!

  • Verified answer
    Jonathan  Halland Profile Picture
    Jonathan Halland 11,302 on at
    RE: Implementing Jumpref or View Details on a List page

    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"));
            }
        }
        
    }
    
  • Verified answer
    sohaibcheema Profile Picture
    sohaibcheema 46,592 User Group Leader on at
    RE: Implementing Jumpref or View Details on a List page

    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(....

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,773 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,513 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans