web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Navigating to new view in mPOS (using D365O)

(0) ShareShare
ReportReport
Posted on by

I've added an extension project as per the examples, have added an event handler in Pos.Extension.ts for a Blank operation, and now clicking on my new button will take me to the correct OperationHandler class. My POS solution looks like this:

AppStructure.png

I'd like to navigate to a new screen, so I have copied the html and Typescript files from InventoryLookupView and sorted out the references so that it all builds. However, I'm having major difficulty actually getting to my new view.

If I call this then I can go to the original one:

Commerce.ViewModelAdapter.navigate("InventoryLookupView");


I'd like to do the same with my new view.

I've added these pieces into my Pos.Extension.ts to try to create the necessary event handlers for my new view:

var navigation: Commerce.IView[] = [

{
title: "Transfers and Wastage View",
page: "ProductTransferWastageView",
phonePage: "ProductTransferWastageView",
path: "../../Pos.Extension.K3.ProductWastage/Views",
viewController: Custom.ViewControllers.ProductTransferWastageViewController
}
];

document.addEventListener('DOMContentLoaded', (event: Event) => {
// operations

Commerce.Operations.BlankOperationHandler.registerBlankOperationHandler("ProductTransfer", new Custom.Operations.ProductWastageOperationHandler());



//deal with navigate event

navigation.forEach((viewConfiguration: Commerce.IView) => {
// Register regular view
if (Commerce.StringExtensions.isNullOrWhitespace(viewConfiguration.page) ||
Commerce.StringExtensions.isNullOrWhitespace(viewConfiguration.path) ||
Commerce.ObjectExtensions.isNullOrUndefined(viewConfiguration.viewController)) {
return;
}

Commerce.ViewModelAdapterWinJS.define(new Commerce.ViewConfiguration(viewConfiguration));
});

});

However, the path is not resolving correctly. 

I'm left with the questions:

1. Am I correct in putting my views into the same new project as my Operation logic?

2. How should I wire up the event handlers so that I can actually navigate to this view?

3. Are there any examples for the Modern POS to show the current recommended way of doing these things (the only examples I've found are old and involve modifying Pos.App and SharedApp code, which I'm sure is now deprecated)? I've done a lot of hunting around on the web looking for guidance on this, but I've not had much joy.

Thanks for any advice you can provide

Duncan

*This post is locked for comments

I have the same question (0)

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans