# Error when trying to select entity to create ticket

**URL:** <https://forum.sambapos.com/t/error-when-trying-to-select-entity-to-create-ticket/10433>\
**Category:** V5 Question\
**Created:** [April 20, 2016, 1:32pm UTC](https://forum.sambapos.com/t/error-when-trying-to-select-entity-to-create-ticket/10433 "2016-04-20T13:32:38Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![antasp3136](https://forum.sambapos.com/user_avatar/forum.sambapos.com/antasp3136/32/52734_2.png) [@antasp3136](https://forum.sambapos.com/u/antasp3136)\
**Post date:** [April 20, 2016, 1:32pm UTC](https://forum.sambapos.com/t/error-when-trying-to-select-entity-to-create-ticket/10433/1 "2016-04-20T13:32:38Z")

</div>

When trying to select and entity from a entity screen to create a ticket i get the follow error then samba crashes. Not sure whats causing this. Only seems to happen when custom navigation is enabled in samba.

* * *

[General Info]

Application: SambaPOS  
Version: 5.1.59  
Region: en  
DB: SQ  
Machine: PMC-SVR01  
User: pmcadmin  
Date: 4/20/2016  
Time: 1:31 PM

User Explanation:

## pmcadmin said “”

[Exception Info 1]

Top-level Exception  
Type: System.NullReferenceException  
Message: Object reference not set to an instance of an object.  
Source: Samba.Modules.EntityModule  
Stack Trace: at Samba.Modules.EntityModule.EntitySelectorViewModel.OnSelectEntityExecuted(EntityScreenItemViewModel obj)  
at Microsoft.Practices.Prism.Commands.DelegateCommand`1.\<\>c\_\_DisplayClass6.\<.ctor\>b\_\_2(Object o)  
at Microsoft.Practices.Prism.Commands.DelegateCommandBase.Execute(Object parameter)  
at Microsoft.Practices.Prism.Commands.DelegateCommandBase.System.Windows.Input.ICommand.Execute(Object parameter)  
at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)  
at System.Windows.Controls.Primitives.ButtonBase.OnClick()  
at System.Windows.Controls.Primitives.ToggleButton.OnClick()  
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)  
at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)  
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)  
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)  
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)  
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)  
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)  
at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)  
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)  
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)  
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)  
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)  
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)  
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)  
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)  
at System.Windows.Input.InputManager.ProcessStagingArea()  
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)  
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)  
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)  
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)  
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)  
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)  
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)  
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)  
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)  
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)  
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)  
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)  
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)  
at System.Windows.Application.RunDispatcher(Object ignore)  
at System.Windows.Application.RunInternal(Window window)  
at System.Windows.Application.Run(Window window)  
at Samba.Presentation.App.Main()

* * *

[Assembly Info]

mscorlib, Version=4.0.0.0  
DevExpress.Xpf.LayoutControl.v14.1, Version=14.1.11.0  
System.Xml, Version=4.0.0.0  
DevExpress.Xpf.Grid.v14.1, Version=14.1.11.0  
System, Version=4.0.0.0  
DevExpress.Xpf.Grid.v14.1.Core, Version=14.1.11.0  
WindowsBase, Version=4.0.0.0  
System.Xaml, Version=4.0.0.0  
Samba.Domain, Version=1.0.0.0  
System.Core, 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  
System.ComponentModel.Composition, Version=4.0.0.0  
PresentationCore, Version=4.0.0.0  
DevExpress.Xpf.Core.v14.1, Version=14.1.11.0  
Samba.Services, Version=1.0.0.0  
Samba.Presentation.Services, Version=1.0.0.0  
System.Windows.Forms, Version=4.0.0.0  
System.Drawing, Version=4.0.0.0  
Stateless, Version=1.0.0.0  
Samba.Persistance, Version=1.0.0.0  
PropertyTools, Version=2012.4.14.1  
Samba.Localization, Version=1.0.0.0  
ReachFramework, Version=4.0.0.0  
Samba.Infrastructure.Data, Version=1.0.0.0  
EntityFramework, Version=6.0.0.0  
FluentValidation, Version=3.4.0.0  
Omu.ValueInjecter, Version=2.3.0.0  
Microsoft.Practices.ServiceLocation, Version=1.0.0.0  
Microsoft.CSharp, Version=4.0.0.0

* * *

[System Info]

Operating System  
-Microsoft Windows 10 Pro  
–CodeSet = 1252  
–CSDVersion =  
–CurrentTimeZone = -240  
–FreePhysicalMemory = 2748492  
–OSArchitecture = 64-bit  
–OSLanguage = 1033  
–ServicePackMajorVersion = 0  
–ServicePackMinorVersion = 0  
–Version = 10.0.10586

Machine  
-PMC-SVR01  
–Manufacturer = Microsoft Corporation  
–Model = Virtual Machine  
–TotalPhysicalMemory = 4294496256  
–UserName =

* * *

---

<div class="post-metadata">

**Author:** ![markjw](https://forum.sambapos.com/user_avatar/forum.sambapos.com/markjw/32/9942_2.png) [@markjw](https://forum.sambapos.com/u/markjw)\
**Post date:** [April 20, 2016, 1:35pm UTC](https://forum.sambapos.com/t/error-when-trying-to-select-entity-to-create-ticket/10433/2 "2016-04-20T13:35:57Z")

</div>

This is possibly the same problem:

> [@Crash on opening ticket issue](https://forum.sambapos.com/t/crash-on-opening-ticket-issue/7810):
>
> Am trying to help someone out who gets; Object reference not set to an instance of an object. On opening a ticket and a software crash. Cannot copy and paste error report as C&P copies the other prompt box but is along these lines; System.Reflection.TargetInvocationException Exception has been thrown mscorlib and System.NullReferenceException Object reference not set to an instance of an object Samba.Presentation.ViewModels Any advice greatly appreciated.

Read through there is a solution further down. Backup your database first then try the solution. If it doesn’t work let us know.

---

<div class="post-metadata">

**Author:** ![antasp3136](https://forum.sambapos.com/user_avatar/forum.sambapos.com/antasp3136/32/52734_2.png) [@antasp3136](https://forum.sambapos.com/u/antasp3136)\
**Post date:** [April 20, 2016, 1:57pm UTC](https://forum.sambapos.com/t/error-when-trying-to-select-entity-to-create-ticket/10433/3 "2016-04-20T13:57:50Z")

</div>

Hmm i looked in the database cant see anything that has null value under entityname so im not sure…

---

<div class="post-metadata">

**Author:** ![markjw](https://forum.sambapos.com/user_avatar/forum.sambapos.com/markjw/32/9942_2.png) [@markjw](https://forum.sambapos.com/u/markjw)\
**Post date:** [April 20, 2016, 3:21pm UTC](https://forum.sambapos.com/t/error-when-trying-to-select-entity-to-create-ticket/10433/4 "2016-04-20T15:21:37Z")

</div>

> [@antasp3136](#):
>
> i looked in the database cant see anything that has null value under entityname

how about entities with blank name?

---

<div class="post-metadata">

**Author:** ![antasp3136](https://forum.sambapos.com/user_avatar/forum.sambapos.com/antasp3136/32/52734_2.png) [@antasp3136](https://forum.sambapos.com/u/antasp3136)\
**Post date:** [April 20, 2016, 3:22pm UTC](https://forum.sambapos.com/t/error-when-trying-to-select-entity-to-create-ticket/10433/5 "2016-04-20T15:22:44Z")

</div>

there were no entities… i cleared out the database.

---

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [April 20, 2016, 4:19pm UTC](https://forum.sambapos.com/t/error-when-trying-to-select-entity-to-create-ticket/10433/6 "2016-04-20T16:19:46Z")

</div>

> [@antasp3136](#):
>
> there were no entities… i cleared out the database.

LOL, then how do expect “Select Entity” to be able to function?

---

<div class="post-metadata">

**Author:** ![antasp3136](https://forum.sambapos.com/user_avatar/forum.sambapos.com/antasp3136/32/52734_2.png) [@antasp3136](https://forum.sambapos.com/u/antasp3136)\
**Post date:** [April 20, 2016, 6:06pm UTC](https://forum.sambapos.com/t/error-when-trying-to-select-entity-to-create-ticket/10433/7 "2016-04-20T18:06:34Z")

</div>

sorry i mean that there is no entities in the sql table entities name like i deleted all the customer entities… so all i have as far as entities goes at the moment are Tables 1-100 but there is no data in the sql table… maybe im looking at it wrong. Ill post a screen shot in a few seconds.

---

<div class="post-metadata">

**Author:** ![antasp3136](https://forum.sambapos.com/user_avatar/forum.sambapos.com/antasp3136/32/52734_2.png) [@antasp3136](https://forum.sambapos.com/u/antasp3136)\
**Post date:** [April 20, 2016, 6:09pm UTC](https://forum.sambapos.com/t/error-when-trying-to-select-entity-to-create-ticket/10433/8 "2016-04-20T18:09:25Z")

</div>

![](https://forum.sambapos.com/uploads/default/original/3X/7/3/732c0f6b4e6756da440e8c56c97f439a1cbd02a1.png)

if i select edit top 200 rows i do see this…

 ![](https://forum.sambapos.com/uploads/default/original/3X/b/6/b63eb81a347edb3c8fc6a21ab67a8640de43047d.png)

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [April 20, 2016, 6:19pm UTC](https://forum.sambapos.com/t/error-when-trying-to-select-entity-to-create-ticket/10433/9 "2016-04-20T18:19:19Z")

</div>

TicketEntities will be entity assignments to tickets, not the entities themselves setup in Samba

Try the Entities table (dbo.Entities) )😉

 ![](https://forum.sambapos.com/uploads/default/original/3X/2/7/27f06b85065b7eddcdaaae2fe969bb9f8f9a3142.png)

---

<div class="post-metadata">

**Author:** ![antasp3136](https://forum.sambapos.com/user_avatar/forum.sambapos.com/antasp3136/32/52734_2.png) [@antasp3136](https://forum.sambapos.com/u/antasp3136)\
**Post date:** [April 20, 2016, 6:36pm UTC](https://forum.sambapos.com/t/error-when-trying-to-select-entity-to-create-ticket/10433/10 "2016-04-20T18:36:22Z")

</div>

Does this look normal then?..

 ![](https://forum.sambapos.com/uploads/default/original/3X/b/6/b6dde1f111452163f4f95882697a68459f0d4a8d.png)

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [April 20, 2016, 6:38pm UTC](https://forum.sambapos.com/t/error-when-trying-to-select-entity-to-create-ticket/10433/11 "2016-04-20T18:38:57Z")

</div>

I dont have any entities without custom data so not sure what that should look like if none configured but tables look to be entity type 2 and guessing thats customers as type 1.

Show a screenshot of your entities list in settings within samba.

---

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [April 20, 2016, 6:39pm UTC](https://forum.sambapos.com/t/error-when-trying-to-select-entity-to-create-ticket/10433/12 "2016-04-20T18:39:31Z")

</div>

Looks normal.

Check your Ticket Type to ensure you do not have any Entity Types listed in there that do not exist.

 ![](https://forum.sambapos.com/uploads/default/original/3X/4/a/4a6101c8191d2926125d31405c59332d0072be37.png)

---

<div class="post-metadata">

**Author:** ![antasp3136](https://forum.sambapos.com/user_avatar/forum.sambapos.com/antasp3136/32/52734_2.png) [@antasp3136](https://forum.sambapos.com/u/antasp3136)\
**Post date:** [April 20, 2016, 6:52pm UTC](https://forum.sambapos.com/t/error-when-trying-to-select-entity-to-create-ticket/10433/13 "2016-04-20T18:52:26Z")

</div>

![](https://forum.sambapos.com/uploads/default/original/3X/1/e/1ea22af76974354ab552d4fd6473ec9dc05f655f.png)

---

<div class="post-metadata">

**Author:** ![antasp3136](https://forum.sambapos.com/user_avatar/forum.sambapos.com/antasp3136/32/52734_2.png) [@antasp3136](https://forum.sambapos.com/u/antasp3136)\
**Post date:** [April 20, 2016, 6:52pm UTC](https://forum.sambapos.com/t/error-when-trying-to-select-entity-to-create-ticket/10433/14 "2016-04-20T18:52:57Z")

</div>

![](https://forum.sambapos.com/uploads/default/original/3X/1/4/14f3d9f0c1a5ddb035605f9815ccc88dba60c201.png)

---

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [April 20, 2016, 6:55pm UTC](https://forum.sambapos.com/t/error-when-trying-to-select-entity-to-create-ticket/10433/15 "2016-04-20T18:55:20Z")

</div>

So if you have no Customer Entities, or more to the point no Customers Entity _Type_, you need to remove the Customers Entity _Type_ from the **Entity Type List** in your Ticket Type.

---

<div class="post-metadata">

**Author:** ![antasp3136](https://forum.sambapos.com/user_avatar/forum.sambapos.com/antasp3136/32/52734_2.png) [@antasp3136](https://forum.sambapos.com/u/antasp3136)\
**Post date:** [April 20, 2016, 6:56pm UTC](https://forum.sambapos.com/t/error-when-trying-to-select-entity-to-create-ticket/10433/16 "2016-04-20T18:56:11Z")

</div>

well im using a blank database so i havent created any yet… I do want to be able to create them…

---

<div class="post-metadata">

**Author:** ![antasp3136](https://forum.sambapos.com/user_avatar/forum.sambapos.com/antasp3136/32/52734_2.png) [@antasp3136](https://forum.sambapos.com/u/antasp3136)\
**Post date:** [April 20, 2016, 6:59pm UTC](https://forum.sambapos.com/t/error-when-trying-to-select-entity-to-create-ticket/10433/17 "2016-04-20T18:59:38Z")

</div>

This error only happens when i choose a table entity from the tables entity screen… weird thing is that if i go to search customer and choose search and choose a customer and then close the ticket and go back to the tables screen it then lets me choose from that screen…

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [April 20, 2016, 7:00pm UTC](https://forum.sambapos.com/t/error-when-trying-to-select-entity-to-create-ticket/10433/18 "2016-04-20T19:00:13Z")

</div>

What have you got in your entity types page (entity section)  
There were 2 entities of type one in the list, I would have thought the entities list would have showed them at top of the list as type 1…  
How did you clear the database? via SQL Managment? as database tools doesn’t remove entities…

---

<div class="post-metadata">

**Author:** ![antasp3136](https://forum.sambapos.com/user_avatar/forum.sambapos.com/antasp3136/32/52734_2.png) [@antasp3136](https://forum.sambapos.com/u/antasp3136)\
**Post date:** [April 20, 2016, 7:12pm UTC](https://forum.sambapos.com/t/error-when-trying-to-select-entity-to-create-ticket/10433/19 "2016-04-20T19:12:22Z")

</div>

This is what happens when i choose a table to create a ticket…

 ![](https://forum.sambapos.com/uploads/default/original/3X/5/2/52df5839a90d40ba5d6b4bbbdc3a680e1664b211.gif)

then if i choose to select a customer entity it works fine… even if i go choose a table entity after a customer entity the table selection then works…

 ![](https://forum.sambapos.com/uploads/default/original/3X/8/b/8b14e9695c00ee6515e3375735439f027ec0cfb8.gif)

---

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [April 20, 2016, 7:14pm UTC](https://forum.sambapos.com/t/error-when-trying-to-select-entity-to-create-ticket/10433/20 "2016-04-20T19:14:33Z")

</div>

Try this:

Remove Tables from your Ticket Type and save.

Add Tables back into your Ticket Type and save.

Also, show the settings for your Table Numbers entity Screen.

[Next page](https://forum.sambapos.com/t/error-when-trying-to-select-entity-to-create-ticket/10433.md?page=2)
