On store transactions (ShowJournalView) there is an advanced search button.
When you go to customer detail view on the SearchView on customers, there is a Order history grid panel and above it a link to All orders for that customer.
This link also calls ShowJournalView, except that the mode is not ShowJournal, but CustomerSalesOrders.
The moment the mode is NOT ShowJournal, the Advanced search button disappears.
If I search for it in Pos.ViewModels.js in RetailSDK, I see there is a "GetAdvancedSearchCriteriaCommand" function that assigns SetISVisible and SetCanExecute to false.
Then further down there is a "GetAdvancedSearchCriteriaCommand.prototype.init " that only if the mode is ShowJournal, change SetIsVisible to true and setCanExecute to true. So this is the reason why the button disappears when called from All orders on the customer details view.
I have a request to add the advanced search on the All orders (ShowJournalMode = CustomerSalesOrders) as well. Any way that I can just make it visible with extensions? I don't really see an extension point for it in "PosApi/Extend/Views/ShowJournalView".
If I can't just change those flags to make it visible and can execute, then by using ShowJournalView.ShowJournalExtensionCommandBase to add a custom button on the appBar, how can I get the customer account number for which the ShowJournalView as called? If one look at the code behind the "All Orders" link on the customer details view, one can see it calls it as follow, so the customer account numbe ris passed in.
var options = { customerAccountNumber: this._customerAccountNumber, mode: ViewModels.ShowJournalMode.CustomerSalesOrders, correlationId: correlationId }; Commerce.ViewModelAdapter.navigate("ShowJournalView", options);
I think I need to get a hold of the ViewModel. Then I can get to the options of the viewModel to get to the customerAccountNumber.
Any suggestions on how to accomplish this custom that I need to do, is much appreciated.