Navigating the Dynamics 365 Transition: Anaxco's Journey to Operational Excellence with Companial's Support
Lire la suiteAdvanced 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.
- What’s New in the 2023 Platform Updates for Microsoft Dynamics 365 Finance & Supply Chain Management: Part 2 - 20/07/2023
- What’s New in the 2023 Platform Updates for Microsoft Dynamics 365 Finance & Supply Chain Management: Part 1 - 20/07/2023
- What’s New in the Platform Updates for Microsoft D365 F&SCM: 2023 Release Wave 1 - 19/04/2023
En savoir plus sur Finance and Supply Chain Management
What’s New in the 2023 Platform Updates for Microsoft Dynamics 365 Finance & Supply Chain Management: Release wave 2
In this blog post, we’ll dive deeper into the 2023 release wave 2 for Dynamics 365 Finance and Supply Chain ...
Lire la suiteRunning Dynamics 365 Finance & Supply Chain Management Data Export with Azure Data Lake V2 and Azure Synapse: Real-Life User Story
In this blog, we’ll explore the process of synchronizing data from Microsoft Dynamics 365 Finance & Supply Chain Management to ...
Lire la suiteWhat’s New in the 2023 Platform Updates for Microsoft Dynamics 365 Finance & Supply Chain Management: Part 2
In this blog, we’ll provide you with a comprehensive overview of the upcoming and recently released improvements in Dynamics 365 ...
Lire la suiteWhat’s New in the 2023 Platform Updates for Microsoft Dynamics 365 Finance & Supply Chain Management: Part 1
As Microsoft Dynamics 365 Finance and Supply Chain Management (previously known as Finance and Operations) receives 8 platform updates annually, ...
Lire la suiteCatch the Momentum of “Bridge to the Cloud 2” Promotion: An Exclusive Opportunity to Migrate your Dynamics AX Customers to Dynamics 365 F&SCM Cloud
Are you looking to modernize your Dynamics AX customers’ business processes and take advantage of the latest Microsoft Dynamics 365 ...
Lire la suite