Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Mobile Device - New list is empty in app

(0) ShareShare
ReportReport
Posted on by 10

In D365F&SCM (FO) I have upgraded a list "page" from AX2012 but the list is empty when the app presents the content. Also, the list of sorting fields is empty and does not include the table fields that are configured to be presented in the list elements.

The list contains the expected result (open purchase order lines) in the simulator.

So what am I missing or doing wrong as I want my class rendered as a list?

The scenario (some details are left out for readability):

* A new class MyPOList is created extending from WHSWorkExecuteDisplay.

* The enums WHSWorkExecuteMode and WorkActivity are extended with element MyPOList.

- The class MyPOList is decorated with "[WHSWorkExecuteMode(WHSWorkExecuteMode::MyPOList)]".

* Two new classes are created to tell the MD framework to render the page/controls as a list:

[WHSWorkExecuteMode(WHSWorkExecuteMode::MyPOList)] // This associates my class with a specific page pattern
class WhsMobileAppServiceXMLDecoratorFactoryMyPOList implements WHSIMobileAppServiceXMLDecoratorFactory
{
    #WHSRF
    public WHSMobileAppServiceXMLDecorator getDecorator(container _con)
    {
        return new WHSMobileAppServiceXMLDecoratorMyPOList(); // This directs the app to the class which defines the page pattern
    }
}
class WHSMobileAppServiceXMLDecoratorMyPOList extends WHSMobileAppServiceXMLDecorator
{
    public WHSMobileAppPagePattern requestedPattern()
    {
        return WHSMobileAppPagePattern::InquiryWithNavigation; // This should tell the app to render the page as a list
    }
}
* The menu item is configured with WorkActivity:MyPOList and the menu item is added to a menu.
* The field setup (from the MD menu item setup) is refactored to use PurchTable and PurchLine instead of work and load. So the query used by MyPOList loops over purchase data which I have tested to work just fine in the simulator.
* During testing all code changes are reflected in the simulator but the list in the app remains empty.
* After every code change I execute "SysExtensionCache::clearAllScopes()" from a runnable class to ensure that the MD framework picks up the changes before I test my code.
* Effects in the app of changes to WHSMobileAppPagePattern:
WHSMobileAppPagePattern::Inquiry:
The page is rendered with what looks like one big control. The expected business data is presented:
5342.pastedimage1575556228957v1.png
WHSMobileAppPagePattern::Custom:
The page is rendered as a 'plain' page (a not as a list) with all my controls presented just as in the simulator. The expected business data is presented:
8877.pastedimage1575556900881v2.png
  • Suggested answer
    Karsten Rasch Profile Picture
    10 on at
    RE: Mobile Device - New list is empty in app

    I figured out the solution by examining some standard WHS-classes which made several references to WHSWorkId when determining if the content of the list should be rendered. Based on that I experimented with a few changes. The conclusion is that the Mobile Device framework expects some of the controls to have a certain name or type as shown below:

        private container buildHeader(container _con, str _buttonClicked, WHSRFMenuItemTable  _menuItemTable)
        {
            if (_menuItemTable.ShowFilter)
            {
                // Here goes standard filter controls
            }
        
            ret  = [this.buildControl(#RFLabel, #WorkList, "My control", 1, '', #WHSRFUndefinedDatatype, '', 0)]; // Name (parameter 2) has to be “Work List” via the macro
    
            // More code...
        }
    
        private container buildTableContents(container _con, WHSRFMenuItemTable  _menuItemTable)
        {
            // ...
    
            purchLine = this.getPurchLineFromQuery();
            _con  = [this.buildControl(#RFButton, purchLine.InventTransId, purchLine.InventTransId,  1, '', #WHSRFUndefinedDatatype, '', 0, true, '', WHSRFColorText::Default, extendedTypeNum(WHSWorkId))]; // Type has to be WHSWorkId
    
            // More code...
        }
    

  • Karsten Rasch Profile Picture
    10 on at
    RE: Mobile Device - New list is empty in app

    Hi André,

    I already have a ticket in progress and will let you know what the conclusion is.

    Yes, the code for my list and the standard list is very similar when it comes to building the controls.

  • André Arnaud de Calavon Profile Picture
    293,129 Super User 2025 Season 1 on at
    RE: Mobile Device - New list is empty in app

    With the new screenshots, I do understand a bit more your issue. The technology has been changed as you know already yourself. I do have the feeling, but not sure, that there are limitations in the Native app. Probably there are restrictions to show only work and item related information.

    Have you verified the coding used for your list and the standard list? (probably yes).

    If so, try to create a ticket for Microsoft Support to get some answers.

  • Karsten Rasch Profile Picture
    10 on at
    RE: Mobile Device - New list is empty in app

    Hi André,

    My question is what am I missing or doing wrong in trying to implement what is rendered as a list in the D365 app.

    It is actually not relevant how the class appeared in AX2012 as the app is different in D365.

    As I understand it from the limited documentation/blogposts, the way is to:

    - Add a new enum element to WHSWorkExecuteMode and WHSWorkActivity.

    - Decorate my "list-class" and a new class (which implements WHSIMobileAppServiceXMLDecoratorFactory) with this new enum element.

    - Setup a new MD-menu item which uses the new enum element in WHSWorkActivity.

    Again, this works just fine in the simulator but the list is empty in the app.

    MyPOList rendered in the D365 app:

    pastedimage1575625194624v1.png

    Standard list (Outbound\Open work list) rendered in the D365 app:

    pastedimage1575625202617v2.png

    MyPOList rendered in the D365 simulator:

    pastedimage1575625212635v3.png

    Standard list (Outbound\Open work list) rendered in the D365 simulator:

    pastedimage1575625222675v4.png

  • André Arnaud de Calavon Profile Picture
    293,129 Super User 2025 Season 1 on at
    RE: Mobile Device - New list is empty in app

    Hi Karsten,

    I'm not sure what exactly is your question here. Probably the result in Dynamics 365 is different compared to AX2012? If so, can you also add a screenshot to show what you had in AX2012?

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,129 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,895 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans