• Home
  • About Me
  • Contact Me
  • Downloads
  • White Papers
  • Web Sites
  • Post List
  • Articles
  • FAQ

Olof Simren - Microsoft Dynamics 365 Business Central Blog

  • Home
  • About Me
  • Contact Me
  • Downloads
  • White Papers
  • Web Sites
  • Post List
  • Articles
  • FAQ

Interaction Between Role Center Parts in Dynamics NAV 2013 R2

May 11, 2014 Posted by Olof Simren Development, General, Miscellaneous No Comments

I thought it would be cool to be able to get the role center parts to interact with each-other in Microsoft Dynamics NAV 2013 R2. I wanted to see if it was possible to have a role center part to display different information based on what was highlighted in another role center part. This way the role center itself would become more interactive.

To test this I wanted to have a role center part with a task list for a work center and based on what operation that was highlighted the related components from the production order should be displayed in another role center part.

This was actually easier than I initially though. There are (at least) two ways to do this, one simple and one more advanced. The simpler approach is to use the ProviderID and SubPageLink properties on the role center part with the components and the more advanced approach is to use a single instance codeunit with global variables representing the filters and add the PingPong add-in to the components page to retrieve the values and apply the filters within intervals.

Below are the two approaches.

First Approach – ProviderID and SubPageLink Properties

The ProviderID is typically used for Factboxes but can also be applied to other types of parts to specify from where then link will come from (this is also useful if you want to have multiple subforms on a page).

Below the ProviderID on the Shop Floor Terminal Components part is set to 1000000000 which is the ID of the Shop Floor Terminal Task List part from where we should retrieve the values for the filters.

providerid-property-on-role-center-page

When the ProviderID is set the SubPageLink property refers to the records in that page. So it is just a matter of specifying the filters, the left columns are the fields in the components page and the right column are either constants or the fields from the records in the page specified as the ProviderID (in our case the task list records). This is it, simple and nice! 🙂

SubPageLink-on-role-center-in-dynamics-nav

Second Approach – Single Instance Codeunit and PingPong Add-in

The first step in this approach is to create a single instance codeunit with global variables that should be used to set the filters in the second role center part. The codeunit then has one function to set the variable and another function to get the variables.

The single instance is set in the property of the codeunit. From the Dynamics NAV help: ‘When you set this property to Yes on a codeunit, all codeunit variables that use this codeunit use the same instance. That is, all codeunit variables of this codeunit use the same set of internal variables when the code is running on the same client. The codeunit remains instantiated until you close the company.’

I name my functions SetComponentFilters and GetComponentFilters, both of them uses three global variable for the production order number, production order line no. and the routing link code. Those are the fields I need to filter my list of components.

Single-Instance-Codeunit-in-Dynamics-NAV

Next is to put code in the first role center part (the task list) to set the global variables in the single instance codeunit based on what record that is highlighted. We do this in the OnAfterGetCurrRecord function by calling the SetComponentFilters function in the single instance codeunit previously created.

CAL-code-to-set-the-filter-variables

Then we use the PingPong add-in in the second role center part as a timer to retrieve the variables, set a filter and update the page within intervals when the page is open. To do this we add a field within a group with the SubType equal to Group (note; adding it withing a repeater group will not work for some reason) and give it a name (in my case I named it PingPong).

ping-pong-add-in-in-Dynamics-NAV

We then open the properties of the new PingPong field and select the PingPong add-in in the ControlAddIn property of the field. From the Dynamics NAV help: ‘The Microsoft Dynamics NAV PingPong add-in can be invoked to request a callback after a specified timeout. The PingPong add-in does one callback on request. The callback is requested from C/AL code by specifying the time to wait in milliseconds.‘

PingPongProperties

Once we have selected the PingPong add-in we can put code in the PingPong::AddInReady and PingPong::Pong functions (funny names I know 🙂 ). In the PingPong::AddInReady function we put code to initiate the ping after 500 milliseconds, in the PingPong::Pong function we put code to retrieve the variables, set the filters, update the page and then call the ping again after 500 milliseconds. This then works similar to the old timer that you could use in the classic client. That’s it! A bit more complicated than the first approach but good to know.

PingPong-add-in-Code-in-Dynamics-NAV

Test the Role Center

Now when I run my role center I can select different lines in the task list part and the part that show components will update accordingly and only show the components that are linked to the selected operation (the result for the two above approaches are the same). Sweet! 🙂

shop-floor-role-center-for-dynamics-nav-2013-R2

Conclusion

I would definitely recommend the simpler approach (by just setting properties), but there are situations where you might want to do more than setting filters in the second role center page. If you look at the screen shot above you also see a Messages role center part to the top right, this part is a temporary table that displays messages based on production order comments, routing tools, etc. doing this requires the second more advanced approach since it is a bit more that just setting a filter.

As you can see, I am building a shop floor terminal role center for Dynamics NAV. In a previous blog I described how to create custom progress bars, which is also part of this role center (as a status indicator in the task list). If this role center gets ready to be used I will make it available in the downloads section. There are still some pieces missing, but maybe in a month or so it will be ready.

Share this:

  • Share on Facebook (Opens in new window) Facebook
  • Share on X (Opens in new window) X

Related


Discover more from Olof Simren - Microsoft Dynamics 365 Business Central Blog

Subscribe to get the latest posts sent to your email.

Tags: Add-inDevelopmentPingPongProviderIDRole Center
No Comments
Share
3

About Olof Simren

I am a Microsoft Dynamics NAV and 365 Business Central Expert, I started implementing Microsoft Dynamics NAV in 2002, back then it was called Navision Attain. Throughout the years there has been many exciting implementations in different parts of the world, all of them with different challenges but with one common theme; manufacturing. As a consultant, I bring over 20 years of experience in implementing Microsoft Dynamics NAV and 365 Business Central within manufacturing and distribution companies. The services I offer includes project management, consultation, development and training. Feel free to contact me if you need help with anything related to Microsoft Dynamics NAV or 365 Business Central. I work through my company Naviona where I team up with other skilled Microsoft Dynamics NAV and 365 Business Central Experts.

You also might be interested in

Additional Outputs on Production Orders

Mar 24, 2014

Having additional outputs on production orders (sometimes refereed to as[...]

Display Symbols and Different Fonts in Dynamics NAV 2013 R2

Apr 29, 2014

Some weeks ago I came across a requirement to be[...]

Debugger Break Rules – Break on Records Changes

Mar 5, 2014

I was debugging something today and I noticed the ‘Break[...]

Leave a Reply

Your email is safe with us.
Cancel Reply

Subscribe to My Blog via Email

Check Out Our Apps in AppSource

My Dynamics NAV Partner

Naviona, LLC

Categories

  • Assembly (3)
  • Development (35)
  • Finance (14)
  • General (28)
  • Inventory (24)
  • Manufacturing (36)
  • Miscellaneous (27)
  • Purchase (9)
  • Sales (11)
  • Warehouse (7)

Tags

.net Add-in AI AppSource Assembly Assembly BOM Business Central CAL Capacity Consumption Contact Copilot Costs Customer Development Dimensions Excel Finance Flushing General Ledger Inventory Item Item Tracking Low-Level Code MRP NAV 2015 NAV 2016 Output Planning Production Production BOM Production Orders Purchase Orders Receipts Reporting Reports Routing Sales Sales Order Stockkeeping Unit Subcontracting Task List Warehouse Warehouse Shipment Work Center

Recent Posts

  • Business Central Configuration Audit using Vibe Coding
  • Copilot in Planning Parameter Worksheet
  • Copilot in Planning Worksheet
  • Copilot Inventory Queries
  • Record Deletion Tool for Business Central in AppSource
  • Reopen Finished Production Orders
  • XML Buffer and CSV Buffer Tables
  • Functionality Improvements in NAV 2017
  • Reversing Production Output and Consumption
  • Return Merchandise Authorization (RMA)

Categories

  • Assembly
  • Development
  • Finance
  • General
  • Inventory
  • Manufacturing
  • Miscellaneous
  • Purchase
  • Sales
  • Warehouse

Contact Us

We're currently offline. Send us an email and we'll get back to you, asap.

Send Message

Categories

  • Assembly (3)
  • Development (35)
  • Finance (14)
  • General (28)
  • Inventory (24)
  • Manufacturing (36)
  • Miscellaneous (27)
  • Purchase (9)
  • Sales (11)
  • Warehouse (7)

Tags

.net Add-in AI AppSource Assembly Assembly BOM Business Central CAL Capacity Consumption Contact Copilot Costs Customer Development Dimensions Excel Finance Flushing General Ledger Inventory Item Item Tracking Low-Level Code MRP NAV 2015 NAV 2016 Output Planning Production Production BOM Production Orders Purchase Orders Receipts Reporting Reports Routing Sales Sales Order Stockkeeping Unit Subcontracting Task List Warehouse Warehouse Shipment Work Center

Recent Posts

  • Business Central Configuration Audit using Vibe Coding
  • Copilot in Planning Parameter Worksheet
  • Copilot in Planning Worksheet
  • Copilot Inventory Queries
  • Record Deletion Tool for Business Central in AppSource
  • Reopen Finished Production Orders
  • XML Buffer and CSV Buffer Tables
  • Functionality Improvements in NAV 2017
  • Reversing Production Output and Consumption
  • Return Merchandise Authorization (RMA)

Recent Comments

  • Olof on Business Central Configuration Audit using Vibe Coding
  • Andrew Trayfoot on Business Central Configuration Audit using Vibe Coding
  • Barrett Allen on Reopen Finished Production Orders
  • Kateryna on Business Central Configuration Audit using Vibe Coding
  • Takeshi Setoya on Reopen Finished Production Orders
  • Steve on Consignment Inventory
  • Olof Simren on Copilot in Planning Worksheet
  • Omaer Amjad on Copilot in Planning Worksheet

© 2026 · Olof Simren

  • Home
  • About Me
  • Contact Me
  • Downloads
  • White Papers
  • Web Sites
  • Post List
  • Articles
  • FAQ
Prev Next