CRASH When all entity screens hidden

My general users can access several entity screens (to create sales, refund, expense tickets etc). But, I don’t want users to switch between these using the entity screen tabs at the top of the screen. To achieve this, I removed the mappings for each entity screen and creating navigation buttons to take the user directly to each entity screen I want them to be able to use.

A crash occurs when I…

  • search for a customer that doesn’t exist
  • create a new customer and create an account for them at the same time
  • choose “select customer” to create a new ticket
  • close the ticket

Please see the example below…

Although I close the ticket immediately, the same issue happens even if I add products to the ticket and then close the ticket.

This crash occurs on a vanilla install of SambaPOS.

The error log is below:

-----------------------------
[General Info]

Application: SambaPOS
Version:     5.1.62
Region:      en
DB:          SQ
Machine:     TH1-DT-04
User:        Matt
Date:        25/05/2017
Time:        14:14

User Explanation:

Matt said ""
-----------------------------

[Exception Info 1]

Top-level Exception
Type:        System.Reflection.TargetInvocationException
Message:     Exception has been thrown by the target of an invocation.
Source:      mscorlib
Stack Trace: at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

Inner Exception 1
Type:        System.NullReferenceException
Message:     Object reference not set to an instance of an object.
Source:      Samba.Services
Stack Trace: at Samba.Services.Implementations.TicketModule.TicketServiceBase.SubmitTicket(Ticket ticket, TicketType ticketType, AppState appState) in C:\Users\emree\Documents\Github\SambaPOSPro\Samba.Services\Implementations\TicketModule\TicketServiceBase.cs:line 490
   at Samba.Services.Implementations.TicketModule.TicketServiceBase.CloseTicket(Ticket ticket, AppState appState) in C:\Users\emree\Documents\Github\SambaPOSPro\Samba.Services\Implementations\TicketModule\TicketServiceBase.cs:line 533
   at Samba.Presentation.Services.Implementations.TicketModule.TicketService.CloseTicket(Ticket ticket)
   at Samba.Modules.PosModule.PosViewModel.CloseTicket()
   at Samba.Modules.PosModule.PosViewModel.OnTicketEvent(EventParameters`1 obj)
   at Microsoft.Practices.Prism.Events.EventSubscription`1.InvokeAction(Action`1 action, TPayload argument)
   at Microsoft.Practices.Prism.Events.EventSubscription`1.<>c__DisplayClass2.<GetExecutionStrategy>b__0(Object[] arguments)
   at Microsoft.Practices.Prism.Events.EventBase.InternalPublish(Object[] arguments)
   at Microsoft.Practices.Prism.Events.CompositePresentationEvent`1.Publish(TPayload payload)
   at Samba.Presentation.Services.Common.ExtensionMethods.Publish[TEventsubject](TEventsubject eventArgs, String eventTopic, Action expectedAction)

-----------------------------

[Assembly Info]

mscorlib, Version=4.0.0.0
Samba.Services, Version=1.0.0.0
Samba.Domain, Version=1.0.0.0
Samba.Infrastructure.Data, Version=1.0.0.0
System.ComponentModel.Composition, Version=4.0.0.0
Samba.Presentation.Services, Version=1.0.0.0
System.Core, Version=4.0.0.0
PresentationCore, Version=4.0.0.0
DevExpress.Xpf.LayoutControl.v14.1, Version=14.1.13.0
System.Xml, Version=4.0.0.0
DevExpress.Xpf.Grid.v14.1, Version=14.1.13.0
System, Version=4.0.0.0
DevExpress.Xpf.Grid.v14.1.Core, Version=14.1.13.0
WindowsBase, Version=4.0.0.0
System.Xaml, Version=4.0.0.0
PresentationFramework, Version=4.0.0.0
Samba.Infrastructure, Version=1.0.0.0
Microsoft.Practices.Prism, Version=4.0.0.0
System.Runtime.Serialization, Version=4.0.0.0
Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0
DevExpress.Xpf.Core.v14.1, Version=14.1.13.0
System.Windows.Forms, Version=4.0.0.0
System.Drawing, Version=4.0.0.0
Samba.Persistance, Version=1.0.0.0
Stateless, Version=1.0.0.0
PropertyTools, Version=2012.4.14.1
Samba.Localization, Version=1.0.0.0
ReachFramework, Version=4.0.0.0
EntityFramework, Version=6.0.0.0
FluentValidation, Version=3.4.0.0
Microsoft.CSharp, Version=4.0.0.0
Omu.ValueInjecter, Version=2.3.0.0
Microsoft.Practices.ServiceLocation, Version=1.0.0.0

-----------------------------

[System Info]

Operating System
-Microsoft Windows 7 Ultimate
--CodeSet = 1252
--CSDVersion = Service Pack 1
--CurrentTimeZone = -300
--FreePhysicalMemory = 27202368
--OSArchitecture = 64-bit
--OSLanguage = 1033
--ServicePackMajorVersion = 1
--ServicePackMinorVersion = 0
--Version = 6.1.7601

-----------------------------

They must be mapped to a ticket type to work like that. Your other option is to build automation with custom widgets and not try to use the default search.

The error is basically saying just that. It can’t find a ticket type that it is expecting. It is designed to work that way.

But each entity screen is assigned to a particular ticket type…

If I create the ticket straight away and don’t create a customer account for the new customer then it works OK…

So all you did was remove mappings? Hmm it seems to be a ticket type issue. So we need to dig deeper. Anything else you changed? It’s definitely not finding the right ticket type for some reason.

It looks to me like you removed them from the ticket type mapping which is what I referred to. That is only way to remove those buttons.

Accounts must have that association to work. Entities don’t need it but accounts do.

Is that a Custom Entity Screen with an Entity Search Widget?

I ask because if I create an Entity Screen set to use Search Mode, that crash does not occur for me.

Hmm… interesting the way your video behaves. Never tried removing Mappings for ALL Entity Screens.

I made a Custom Entity Screen with no Entity Type, and removed the Mappings.

Added Entity Search Widget to the Screen, and set the Widget Entity Type to Customers.

Added Automation Command to NAV screen to navigate to new Custom Entity Screen.

Create Customer
Create Account, and …

… the screen switches to display the headers for other Customer Entity Screens, with my top-most Customer Entity Screen selected (Automatic / Entity Grid), and of course the Custom Screen is not shown because it has no Entity Type.

I created a brand new database. The only things I did were

  • remove the mappings from the 2 default entity screens
  • enable custom navigation with default buttons
  • add new automation command button to jump straight to “customer search”

That’s all I did, but as you can see in the video, for some reason it’s not working???

Yes, this is the behavior I didn’t want. The reason I did custom navigation was because I wanted to take the operator straight to the customer search screen and not let them see the other headers. When I saw headers were being displayed after creating the account I thought… Easy, I’ll just unmap every entity screen… But then I found this issue.

1 Like

I originally asked a question about how to avoid these headers appearing a while back, but got no response…

It would be great if it’s possible to achieve this. Let me know if anyone has any ideas…

1 Like

By 5.2.7 version hiding all entity screens should not crash.

4 Likes