Samba POS Crash when I select Customer

I am facing issue with Samba whenever I try to add customer before creating tickets its crash but if I select the customer after creating ticket its work properly, may be issue with my Rule to Ask for customer Last Ticket but same data base is working perfect in my old pc I want to just move but cant due to this error.
Screenshot 2024-06-07 202403

Samba Record New

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

Application: SambaPOS
Version:     5.7.10
Region:      en
DB:          SQ
Machine:     SERVER-PC
User:        Admin
Date:        6/7/2024
Time:        3:07 PM

User Explanation:

Admin 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.AutomationModule.RuleExecutor.ExecuteWithoutLogging(Object ruleData)
   at Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWith(Object dataParameter)
   at Samba.Services.Implementations.AutomationModule.NotificationService.NotifyEvent(String eventName, Object dataParameter, AppState appState)
   at CallSite.Target(Closure , CallSite , INotificationService , String , Object , AppState )
   at Samba.Services.Implementations.AutomationModule.CommandExecutionService.ExecuteAutomationCommand(AppState appState, String commandName, String commandValue, Object dataObject, Boolean background)
   at CallSite.Target(Closure , CallSite , ICommandExecutionService , AppState , String , String , Object , Boolean )
   at Samba.Services.ActionProcessors.AutomationModule.ExecuteAutomationCommand.Process(ActionData actionData, RuleExecutionContext context)
   at Samba.Services.Common.RuleActionTypeRegistry.ProcessAction(String actionType, ActionData actionData, RuleExecutionContext context)
   at Samba.Services.Implementations.AutomationModule.AutomationService.ProcessAction(String actionType, ActionData actionData, RuleExecutionContext context)
   at Samba.Services.Implementations.AutomationModule.ActionDataBuilder.<>c__DisplayClass13_0.<InvokeWith>b__0()
   at System.Windows.Threading.Dispatcher.Invoke(Action callback, DispatcherPriority priority, CancellationToken cancellationToken, TimeSpan timeout)
   at System.Windows.Threading.Dispatcher.Invoke(Action callback)
   at Samba.Services.Implementations.AutomationModule.ActionDataBuilder.InvokeWith(AppState appState, RuleExecutionContext context)
   at Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWithoutLogging(Object ruleData)
   at Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWith(Object dataParameter)
   at Samba.Services.Implementations.AutomationModule.NotificationService.NotifyEvent(String eventName, Object dataParameter, AppState appState)
   at Samba.Presentation.Services.Implementations.AutomationModule.NotificationClient.NotifyEvent(String eventName, Object dataObject)
   at Samba.Presentation.ClientLibrary.Modules.PosModule.PosViewModel.(Entity )
   at Samba.Presentation.ClientLibrary.Modules.PosModule.PosViewModel.(EventParameters`1 )
   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
System, Version=4.0.0.0
Samba.Services, Version=5.7.8889.30724
Samba.Domain, Version=5.7.8889.30722
Samba.Infrastructure.Data, Version=5.7.8889.30721
System.ComponentModel.Composition, Version=4.0.0.0
Samba.Presentation.Services, Version=5.7.8889.30727
System.Core, Version=4.0.0.0
PresentationCore, Version=4.0.0.0
WindowsBase, Version=4.0.0.0
PresentationFramework, Version=4.0.0.0
DevExpress.Xpf.LayoutControl.v17.2, Version=17.2.13.0
System.Xml, Version=4.0.0.0
DevExpress.Xpf.Grid.v17.2, Version=17.2.13.0
DevExpress.Xpf.Grid.v17.2.Core, Version=17.2.13.0
System.Xaml, Version=4.0.0.0
Samba.Infrastructure, Version=5.7.8889.30718
System.Net.Http, Version=4.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.v17.2, Version=17.2.13.0
System.Windows.Forms, Version=4.0.0.0
System.Drawing, Version=4.0.0.0
Samba.Persistance, Version=5.7.8889.30722
Stateless, Version=1.0.0.0
PropertyTools, Version=2012.4.14.1
Samba.Localization, Version=5.3.8889.30719
ReachFramework, Version=4.0.0.0
EntityFramework, Version=6.0.0.0
FluentValidation, Version=3.4.0.0
NCalc, Version=1.3.8.0
Microsoft.CSharp, Version=4.0.0.0
Omu.ValueInjecter, Version=2.3.0.0
Microsoft.Practices.ServiceLocation, Version=1.0.0.0
DevExpress.Data.v17.2, Version=17.2.13.0
WindowsInput, Version=1.0.4.0

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

[System Info]

Operating System
-Microsoft Windows 11 Pro
--CodeSet = 1252
--CSDVersion = 
--CurrentTimeZone = -420
--FreePhysicalMemory = 7622232
--OSArchitecture = 64-bit
--OSLanguage = 1033
--ServicePackMajorVersion = 0
--ServicePackMinorVersion = 0
--Version = 10.0.22631

Machine
-SERVER-PC
--Manufacturer = AZW
--Model = SER
--TotalPhysicalMemory = 13877780480
--UserName = SERVER-PC\Admin

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


The rule you have showing has nothing to do with selecting a customer when creating a ticket.

Have you made an recent changes to your production database? Maybe look there.

On your laptop turn on Rules Debugger and select a Customer. Look at the debugger for the rules that fired. Then look on your production database for those rules. Maybe compare them with your laptop database rules.

I have checked all the Rules by “Test Rules” Button. The result is

But I checked a Rule “RU LT Entity Selected Load Entity” Manually I fount a error may be this is cause of failure. see attached image.

If the problem is in this Rule please mention solution. thanks

You will have to edit the action AC LT LoadEntityBySearch, change the parameter [:EntityTypeName] to something else, perhaps [:entity type name] (all lower case).

Go back to the rule and remove the action, save the rule, reopen the rule and add the action back in (moving the rule to the top of the list), then add the above info back into the rule, then save.

I have tried but same issue. I am surprised that it is working perfectly in my old computer as you can see in given recording.
Samba Working

One thing I would like to mention here is that ٰI have un mapped all Rules related to “Open Last Ticket” but the same problem is facing its mean may be any other Rule is creating problem but how can I find.

In the constraint field of the action AC LT ExecAMC put 1==2 save the rule and test. This will help us find out if the error is before this point of after. If you still get the error, remove the constraint from the action and un-map the rule and test again.

Is there a tutorial you used for this?

by putting 1==2 in AC LT ExecAMC constraint field customer is selected but Last Ticket function not working
Screenshot 2024-06-08 092231

Is there a tutorial you used for this?

I imported it from a file for “Customer Last Ticket”
2c788895551babe5.zip (1.4 KB)

Great, we are making progress. We know it can load a customer to create a new ticket. It is the ask question that is probably causing the issue.

Can you show a screen shot of the action AC LT Ask Load Last Ticket? And the Rule that is using AM LT Load Last Ticket (found on the very first image you posted when you started this thread).

Sure. here are AC LT Ask Load Last Ticket and some Rules




Screenshot 2024-06-08 094209
Screenshot 2024-06-08 094219

You do have a custom field named ‘LastTicketId’ defined under the Customers Entity Type, right?

In your rules, try replacing {ENTITY DATA:LastTicketId} with {ENTITY DATA:Customers:LastTicketId}

I have to head home now, I will not be able to continue this discussion for another 11 hours. Somebody else might chime in and help out.

1 Like

I imported your file to a default database. I was able to get it to work without any issues on my end. There is an error I noticed:

Change the highlighted constraint to Equals.

This will save the Ticket Id when a ticket is paid if full. With it set to Greater, it would only save the Ticket Id when a ticket is closed without full payment.

Also, you do not have to convert Ticket Id to a number (the [=TN(' x ')] ). Usually you will only do that to do maths (add, subtract, multiply and divide) or if you are doing a constraint test against a number. I do not think it will be an issue, but it is a point of a typo when not needed.

Is it just 1 customer that is causing the error? Have you tried different customers? In your original video, it appears you are using 2 different customers.

Tried but same. Its very strang that its working on every side but when I Import database to this pc it create problem.

Client PC

Try putting in 1==2 in the ask question action in the rule RU LT Load Last Ticket (ask). It will cause the ask question to not fire, but we can determine if that is the cause.

ZzrhbxSS3R

Tried but cant

I am sharing recording and complete configuration.

This is my current PC recording
My PC

and this is my new pc recording
Client PC

Automation Command

Screenshot 2024-06-08 193710

Action
1-AC LT Ask Load Ticket

Screenshot 2024-06-08 193842

2-AC LT Create Ticket Clone
Screenshot 2024-06-08 194029

3-AC LT Display Ticket

Screenshot 2024-06-08 194112

4-AC LT ExecAMC
Screenshot 2024-06-08 194137

5-AC LT LoadEntityBySearch

Screenshot 2024-06-08 194201

6-AC LT Load Ticket
Screenshot 2024-06-08 194248

7-AC LT Update Entity Data

Screenshot 2024-06-08 194324

Rule
1-RU LT Load Last Ticket

2-RU LT Clone Ticket

3-RU LT Load Last Ticket (ask)

4-RU LT Entity Selected Load Entity
Screenshot 2024-06-08 194834

5-RU LT Ticket Closing Store Customer Data TicketId
Screenshot 2024-06-08 195012

Entity Type Customers

Screenshot 2024-06-08 195658

I do not understand? Did you get an error?

What I am trying to do for you is find the cause of the error. Once we know where the error is at, we can fix it. I’m not trying to fix the error yet.

I’m thinking it might be in the Ask Question. Try removing the action AC LT Ask Load Last Ticket action, save the rule and re-add the action back in with the same parameters.

Ok. This is a bizarre situation. I remoted into his computer. Everything looks fine, but it does crash. I was able to stop it from crashing when I turned on the Rules Debugger. I have read of instances where the Rules Debugger will cause issues in certain situations. But I have not heard of it correction a situation with it just turned on. I tested a multiple times with and without the rules debugger on with the same results.

Does anybody have any suggestions why this would happen?

It seems the order he may be firing some sequences could be off. Can you try rearranging or adding a delay. It could be firing too fast. Rule debugger slows it down a tad

1 Like