In this blog, we are going to guide you through the following steps required for the successful configuration of Power ...
Meer lezenAdvanced WHS Mobile Device Development: [Part 3] – The Sales Line-List Functionality
Wednesday, July 15, 2020
Reading time: 3 minutes
Welcome to the third part of our WHS mobile device development series where we walk through a three-step process to implement process guide framework in Dynamics 365 Finance & Supply Chain Management.
Throughout this blog, you will learn how the process guide framework can be utilized to create a list window in Dynamics 365 Finance & Supply Chain Management mobile device.

Dynamics 365 WHS Mobile Device Development: Step 2 - Sales Line List
This step is the most complicated of all the steps in this blog series, however, it has similarities to the old standard that we have discussed in the previous blog posts. The logic is the same but wrapped in a different syntax. List functionality has a similar structure to the previous versions. Primarily, it requires three methods:
- buildHeader()
- buildTableContents()
- buildPagingControls()
In the buildHeader() method you can add the title of the step, filtering buttons and buttons for additional tile information. As an example, we will be showing sales line quantity and sales price as additional fields.
//Fort title, filtering and additional field display
private void buildHeader(ProcessGuidePage _page)
{
_page.addLabel(SOLINELIST, SOLINELIST, extendedTypeNum(WHSRFUndefinedDataType));
//Add a button for every additional field
_page.addButton(step.createAction(#ActionOk), false, ProcessGuideDataTypeNames::Qty);
_page.addButton(step.createAction(#ActionOk), false, ProcessGuideDataTypeNames::Field);
}
The buildTableContents() method is responsible for populating the list with values. Usually, a query is used to iterate through records that match your requirements. In this scenario, the primary field is Item ID + sales line number but it can be whatever you like it to be. A code that adds sales line information is the following:
private void addSalesLineTolist(ProcessGuidePage _page, SalesLine _salesLine)
{
str id = _salesLine.ItemId + ‘, ‘ + int642Str(_salesLine.LineNum);
str qty = num2Str(_salesLine.SalesQty, 0, 2, DecimalSeparator::Dot, ThousandSeparator::Space);
str price = num2Str(_salesLine.SalesPrice, 0, 2, DecimalSeparator::Dot, ThousandSeparator::Space);
//First add list id as a button
_page.ERAAddMultiActionButton(step.createAction(#ActionSelect), extendedTypeNum(ItemId), id);
//You can add additional fields or display methods to the list button
_page.addLabel(qty, qty, extendedTypeNum(SalesQty));
_page.addLabel(price, price, extendedTypeNum(SalesPrice));
}
We had to create a new ERAAddMultiActionButton() method to the ProcessGuidePage class since the original method was suited for just one particular process. This function is necessary to display records as a list view in the mobile device. This method looks like the following:
public void ERAAddMultiActionButton(ProcessGuideAction _action,
ExtendedTypeId _inputType,
str _label = ”,
boolean _isDefaultAction = false)
{
ProcessGuidePageMultiActionButton button = ProcessGuidePageMultiActionButton::newFromParameters(_action, _inputType, _label, _isDefaultAction);
button.parmButtonData(_label);
this.addControl(button);
}
If you need to display additional information in the tile you have to add those fields using the _page.addLabel() method (see the example above).
Finally, we use the buildPagingControls() method to add list view-related buttons to the user interface.
//Add buttons
private void buildPagingControls(ProcessGuidePage _page)
{
_page.addButton(step.createAction(#RFPrev), false, “@SYS101819“);
_page.addLabel(”, strFmt(“@WAX:WorkListPageControls“,
pageManager.getPageStart(), pageManager.getPageEnd(), pageManager.parmTotalRecords()), extendedTypeNum(WHSRFUndefinedDataType));
_page.addButton(step.createAction(#RFNext), false, “@SYS307055“);
_page.addButton(step.createAction(#ActionBackProcess));
}
For this step, ERASalesProcessGuidePromptSalesLineListStep class will save the selected tile information to the WhsrfPassthrough object and check that it is not empty:
public static const str SALESLINEC = ‘salesLine‘;
protected boolean isComplete()
{
#ProcessGuideActionNames
WhsrfPassthrough pass = controller.parmSessionState().parmPass();
if (!pass.exists(SALESLINEC))
{
return false;
}
return true;
}
public void doExecute()
{
str salesLine = controller.parmClickedData();
if (salesLine)
{
WhsrfPassthrough pass = controller.parmSessionState().parmPass();
pass.insert(SALESLINEC, salesLine);
}
super();
}
If there’s a need, you can process the selected data in the doExecute() method and then continue with your process.
The result of this step should look similar to figure below:
We hope that you have found these insights helpful and that they will help in improving your WHS mobile device development in Dynamics 365 Finance and Supply Chain Management. Don’t hesitate to contact our team at service@companial.com if you have any questions or require any further information!
In case you missed Part 1 or Part 2 of the blog series, be sure to check them out to find out more about the first steps in the process guide framework.
Part 4 of this series on the Dynamics 365 Finance & Supply Chain Management WHS mobile development process is available here.
Edgaras Radvilas is a devoted Microsoft Dynamics AX professional with more than 7 years of experience in AX 2009, AX 2012, and Dynamics 365 F&SCM development and upgrades. His responsibilities also include solution architecture, technical design preparation, implementation, testing, and support duties. Skilled in X++ development for Sales, Purchases, Project management, Inventory and Warehouse management, Finances modules, as well as in building custom service-based integrations. In addition to that, he also has experience with warehouse management mobile app development.
- How to Solve RDL Sandboxing Problems that Arise When Opening SSRS Reports for D365 F&SCM 10.0.13 Platform Update - 18/01/2023
- Advanced WHS Mobile Device Development: [Part 4] – How to Display Sales Order Line Details - 05/12/2022
- Advanced WHS Mobile Device Development: [Part 3] – The Sales Line-List Functionality - 30/11/2022
Meer over Finance and Supply Chain Management
How to deploy Power BI report from Dynamics 365 F&SCM through LCS project asset library
We will show you how to add your Power BI report to your LCS Project Asset library and how to ...
Meer lezenHow do Existing AX Customers Benefit from Moving to Dynamics 365 Finance and Supply Chain Management in the Cloud?
If your customers are still considering whether to move to D365 or not, we‘re here to provide an overview of ...
Meer lezenHow to Solve RDL Sandboxing Problems that Arise When Opening SSRS Reports for D365 F&SCM 10.0.13 Platform Update
In this blog we would like to share our experience of overcoming issues as well as insights to help make ...
Meer lezenHow to keep the newest D365 F&SCM system updated without any hassle
In this blog post we are going to answer all questions and dispel any doubts that your customer might have ...
Meer lezenHow to avoid issues with Virtual Company settings when migrating Microsoft Dynamics AX 2012 (or older versions) to D365 F&SCM
Migrating data from AX2012 (or an older version) to Microsoft D365 for F&SCM may present unexpected challenges. In this blog, ...
Meer lezen