Customer Account Statements and Payments (Custom)

Yes, type them in manually. No need to create them. There is no reason to create an Automation Command unless it will be used as a button somewhere. In this case, we don’t need buttons, so there is no need to create them. They will still work properly when manually entered - just be sure no typos.


Display Ticket is just as it sounds - it is a Display Ticket Action…

##Display Ticket##

Action Name: Display Ticket
Action Type: Display Ticket
###Parameters:###
Ticket Id: [:TicketId]

MSG TEST is a Show Message Action. You do not need to put this Action in your Rules - it was just used for debugging. You can skip it, but here it is anyway…

##MSG TEST##

Action Name: MSG TEST
Action Type: Show Message
###Parameters:###
Message: [:MessageToDisplay]

I do not plan to make a Configuration Task for this. I will supply DB Import files however. In time…

1 Like

Has anyone managed to implement this?
I keep getting the following error.

User Explanation:

User 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.Reflection.RuntimeMethodInfo.UnsafeInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(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 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, 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.Threading.DispatcherOperation.Wait(TimeSpan timeout)
   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherOperation operation, CancellationToken cancellationToken, TimeSpan timeout)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at Samba.Presentation.Services.Common.ExtensionMethods.PublishEvent[TEventSubject](TEventSubject eventArgs, String eventTopic, Boolean wait)
   at Samba.Presentation.Services.Implementations.AutomationModule.NotificationClient.<>c.<NotifyEvent>b__3_0(ActionData x)
   at Samba.Services.Implementations.AutomationModule.ActionDataBuilder.InvokeFor(Action`1 dataAction)
   at CallSite.Target(Closure , CallSite , Object , Action`1 )
   at Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWithLogging(Object dataParameter, Action`1 dataAction)
   at Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWith(Object dataParameter, Action`1 dataAction)
   at Samba.Services.Implementations.AutomationModule.NotificationService.NotifyEvent(String eventName, Object dataParameter, Int32 terminalId, Int32 departmentId, Int32 userRoleId, Int32 ticketTypeId, Action`1 dataAction)
   at Samba.Presentation.Services.Implementations.AutomationModule.NotificationClient.NotifyEvent(String eventName, Object dataObject)
   at CallSite.Target(Closure , CallSite , INotificationClient , String , Object )
   at Samba.Modules.AccountModule.AccountSelectorViewModel.OnAutomationCommandSelected(AccountScreenAutmationCommandMap 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 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, 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.Threading.Dispatcher.Run()
   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()

Inner Exception 1
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.Reflection.RuntimeMethodInfo.UnsafeInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(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 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, 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.Threading.DispatcherOperation.Wait(TimeSpan timeout)
   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherOperation operation, CancellationToken cancellationToken, TimeSpan timeout)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at Samba.Presentation.Services.Common.ExtensionMethods.PublishEvent[TEventSubject](TEventSubject eventArgs, String eventTopic, Boolean wait)
   at Samba.Presentation.Services.Implementations.AutomationModule.NotificationClient.<>c.<NotifyEvent>b__3_0(ActionData x)
   at Samba.Services.Implementations.AutomationModule.ActionDataBuilder.InvokeFor(Action`1 dataAction)
   at CallSite.Target(Closure , CallSite , Object , Action`1 )
   at Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWithLogging(Object dataParameter, Action`1 dataAction)
   at Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWith(Object dataParameter, Action`1 dataAction)
   at Samba.Services.Implementations.AutomationModule.NotificationService.NotifyEvent(String eventName, Object dataParameter, Int32 terminalId, Int32 departmentId, Int32 userRoleId, Int32 ticketTypeId, Action`1 dataAction)
   at Samba.Presentation.Services.Implementations.AutomationModule.NotificationClient.NotifyEvent(String eventName, Object dataObject)
   at CallSite.Target(Closure , CallSite , INotificationClient , String , Object )
   at Samba.Presentation.Common.Services.CommandExecutionService.ExecuteAutomationCommand(String commandName, String commandValue, Object dataObject)
   at CallSite.Target(Closure , CallSite , ICommandExecutionService , String , String , Object )
   at Samba.Modules.AutomationModule.ActionProcessors.ExecuteAutomationCommand.Process(ActionData actionData)
   at Samba.Services.Common.RuleActionTypeRegistry.ProcessAction(String actionType, ActionData actionData)
   at Samba.Services.Implementations.AutomationModule.AutomationService.ProcessAction(String actionType, ActionData actionData)
   at Samba.Modules.AutomationModule.AutomationModule.<OnInitialization>b__5_0(EventParameters`1 x)
   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)

Inner Exception 2
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.Reflection.RuntimeMethodInfo.UnsafeInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(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 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, 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.Threading.DispatcherOperation.Wait(TimeSpan timeout)
   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherOperation operation, CancellationToken cancellationToken, TimeSpan timeout)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at Samba.Presentation.Services.Common.ExtensionMethods.PublishEvent[TEventSubject](TEventSubject eventArgs, String eventTopic, Boolean wait)
   at Samba.Presentation.Services.Implementations.AutomationModule.NotificationClient.<>c.<NotifyEvent>b__3_0(ActionData x)
   at Samba.Services.Implementations.AutomationModule.ActionDataBuilder.InvokeFor(Action`1 dataAction)
   at CallSite.Target(Closure , CallSite , Object , Action`1 )
   at Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWithLogging(Object dataParameter, Action`1 dataAction)
   at Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWith(Object dataParameter, Action`1 dataAction)
   at Samba.Services.Implementations.AutomationModule.NotificationService.NotifyEvent(String eventName, Object dataParameter, Int32 terminalId, Int32 departmentId, Int32 userRoleId, Int32 ticketTypeId, Action`1 dataAction)
   at Samba.Presentation.Services.Implementations.AutomationModule.NotificationClient.NotifyEvent(String eventName, Object dataObject)
   at CallSite.Target(Closure , CallSite , INotificationClient , String , Object )
   at Samba.Presentation.Common.Services.CommandExecutionService.ExecuteAutomationCommand(String commandName, String commandValue, Object dataObject)
   at CallSite.Target(Closure , CallSite , ICommandExecutionService , String , String , Object )
   at Samba.Modules.AutomationModule.ActionProcessors.ExecuteAutomationCommand.Process(ActionData actionData)
   at Samba.Services.Common.RuleActionTypeRegistry.ProcessAction(String actionType, ActionData actionData)
   at Samba.Services.Implementations.AutomationModule.AutomationService.ProcessAction(String actionType, ActionData actionData)
   at Samba.Modules.AutomationModule.AutomationModule.<OnInitialization>b__5_0(EventParameters`1 x)
   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)

Inner Exception 3
Type:        Microsoft.ClearScript.ScriptEngineException
Message:     Object expected
Source:      ClearScript
Stack Trace: at Microsoft.ClearScript.ScriptEngine.ThrowScriptError(IScriptEngineException scriptError)
   at Microsoft.ClearScript.Windows.WindowsScriptEngine.ThrowScriptError(Exception exception)
   at Microsoft.ClearScript.Windows.WindowsScriptEngine.<>c__DisplayClass51_0`1.<ScriptInvoke>b__0()
   at Microsoft.ClearScript.ScriptEngine.ScriptInvoke[T](Func`1 func)
   at Microsoft.ClearScript.Windows.WindowsScriptEngine.ScriptInvoke[T](Func`1 func)
   at Microsoft.ClearScript.Windows.WindowsScriptEngine.Execute(String documentName, String code, Boolean evaluate, Boolean discard)
   at Samba.Services.Implementations.ExpressionModule.ExpressionEngine.Invoke(String expression, String function, Object dataObject, Object[] args)
   at Samba.Services.Implementations.ExpressionModule.ExpressionService.InvokeScript(String handlerFunction, Object dataObject)
   at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
   at Samba.Modules.AutomationModule.ActionProcessors.ExecuteScript.Process(ActionData actionData)
   at Samba.Services.Common.RuleActionTypeRegistry.ProcessAction(String actionType, ActionData actionData)
   at Samba.Services.Implementations.AutomationModule.AutomationService.ProcessAction(String actionType, ActionData actionData)
   at Samba.Modules.AutomationModule.AutomationModule.<OnInitialization>b__5_0(EventParameters`1 x)
   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
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

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

if i disable the “AS Set Statement Variables” rule it does not crash.
With this disabled I opened the debugger and noticed the command value does not seem to be passing to the second automation command.


I have been at this since this tutorial was posted and I cant seem to get it working.
I have also tried a different database with only sample data to rule out a conflict with any of my modifications

The Action in that Rule is set to run a JScript function:

I just noticed the function shown there is not in the Tutorial. I have added it… thanks for letting me know.

function ExecStoredScript(script) {
  var r = sql.Exec(script);
  return r;
}

function getRow(sqlcmd) {
  var r = sql.Query(sqlcmd).First;
  return r;
}

On the param: is Account Statement the name of the Entity Screen? When I select it it just navigates me to the POS Customer Search Entity Screen, (Its top of the sort list) Is this how its supposed to work or should it navigate directly to the Account Operations Entity Screen.

Also when I press Account Operations from the accounts page It will not work. It works fine from a ticket.

When I remove the Constraint: [=TN(‘{SETTING:AS Entity Id}’)]>0 It navigates but does not display any data so it looks like {SETTING:AS Entity Id} Is not being passed from the accounts screen.

Yes, Account Statement is the name of the Entity Screen. I have added this to the last step of the Tutorial (Entity Screen Design).

EDIT: I got this working.
I created a separate Automation Command to use on the accounts screen. And then created the following rule.

Where the payment transaction description is formatted?
I found the Description Template for the account credit.
I just want it to show “Customer Cash Payment” or *Customer Credit Card Payment"

Is it possible to set the format for the date filter ####-##-##

I have added a new rule to reset “AS Date Filter Beg” when the “Date Filter - Editor Widget” is cleared.
Without this “AS Date Filter Beg” remains on the last value entered into the Editor Widget.
If I can get “AS Entity Date_ZeroBalance” working I plan to have it default to this date if it is available

Is there any reason why db.ExecStoredScript(’@@LoadEntityVariables’) is not updating “AS Entity Date_ZeroBalance”

I have executed the following query on my database and the result is correct
select max(date) from (select date,sum(debit-credit) over (order by date) as balance from [SambaPos5].[dbo].[AccountTransactionValues] where AccountId = 78) sub where balance = 0

Result is 2015-12-12 23:28:03.973

EDIT: the AS Set Statement Variables rule seems to be missing a AS Store Value action to save this data

2 Likes

When making payment to account via Payment Screen, part of the description is fixed. A portion of the description is added via the pay.UpdateDescription() script. But if you are trying to get rid of “Ticket Number:” etc, I do not think this can be done. Have not looked into it.

Yes, the Editor Widget has an Edit Mask parameter…

\d{0,4}-\d{0,2}-\d{0,2}

Sorry I cannot find any reference to “NV Close Screen” in the Forums. On the Account Screen it references this automation command. Do you mean close ticket?

It is an unmapped Automation Command, which when clicked navigates to the Main Menu (Nav Screen).

It is not included in the Tutorial because it isn’t necessary for the functionality of this setup, but it is something that I include on all of my Account Screens so that I don’t need to click Main Menu in the bottom-right of the SambaPOS screen.


##Automation Command


##Action

##NV Show Navigation Screen##

Action Name: NV Show Navigation Screen
Action Type: Navigate Module
###Parameters:###
Module Name: Navigation
Parameter:

##Rule

##NV Close Screen##

Rule Name: NV Close Screen
Event Name: Automation Command Executed
Custom Constraint List:
Execute Rule if: Matches
Automation Command NameEqualsNV Close Screen

##Actions:##

NV Show Navigation Screen

Constraint: (none)


1 Like

Thank you. I’m getting better at this but I still need my hand held a little longer, lol.

I am just trying to minimize user error.
I have configured date filter to only update when it contains all 10 characters using the Length Equals constraint.


I have another rule to reset AS Date Filter Beg when Date Filter is empty or not formatted correctly but there is no option for Length Less than or Length does not equal.
Is it possible to do something like this?

1 Like

You could perform the Length operation on the left side, something like:

[='{SETTING:ASDF}'.Length] Greater 9

[='{SETTING:ASDF}'.Length] Less 11

Then set your Rule Constraint to Matches All

1 Like

When Using the Pay Account from the Account Statement Entity screen.
When Printing a reciept how can I have the tendered amount displayed?
I have tried {TENDERED TOTAL} {AMOUNT} {TARGET AMOUNT} {TARGET CREDIT} {TARGET DEBIT} {SOURCE AMOUNT} {SOURCE CREDIT} {SOURCE DEBIT} {TENDERED TOTAL} {PAYMENT TOTAL}

You could create a Template for that, then use the Print Account Transactions Document action, and supply the DocId from the Report.

The printing seems to have stopped working since the 5.1.58 update.
{REPORT SQL DETAILS:@@GetStatement: F.Date.desc,F.TicketId,F.TicketNo,F.Desc,F.Amount,F.Balance:: <J00>{0}| {1}| {2}| {3}| {4}| {5} returns no results.
The report runs fine


But when I print it does not give any transaction data

I thought it may be a template issue (I’m using the document printer) but I changed it to a windows printer and used the template provided here and no change

Has anyone else noticed this or is it just my setup?

QMcKay are you still using this setup? I have tried using the REPORT SQL DETAILS: tag to call the results from other queries and they are working fine but for some reason the @@GetStatement: will not work. If you still have this could you check to see if its working on your setup

I do use it for display, but I never actually use it for printing. I will check to see if it still works for printing…

EDIT: broken…

At least its not just me. I have been trying to troubleshoot this all day. I thought the REPORT SQL DETAILS tag was broken in the latest update but it works fine for other queries


It was working fine the last time I checked back in February. I only recently updated to 5.1.58 so I am presuming it has something to do with this update.

Ok, here is the fix.

It has to do with the name of one of the columns in the SQL, and in the Template. Specifically, I believe it is the field named [Desc]. I think the parsing of the Template is confused when it sees Desc, since that is a reserved word. So we need to change it…

I changed in the SQL every occurance of [Desc] with [Description].
I also changed [Date] with [TxDate] just for good measure.

The Template fields must match the names of the SQL fields being returned, so I modified the field names to match the SQL names:

[ENTITY]
<T>ACCOUNT STATEMENT
<J00>Customer: {ENTITY NAME}|Account: {ACCOUNT NAME}
<J00>Tx Since: {SETTING:AS Date Filter Beg}|Balance: {ENTITY BALANCE}
<F>=
<J00>Date| TID| TNo| Description| Amount| Balance
<F>-
{REPORT SQL DETAILS:@@GetStatement:
F.TxDate.desc,F.TicketId,F.TicketNo,F.Description,F.Amount,F.Balance::
<J00>{0}| {1}| {2}| {3}| {4}| {5}
}
<F>=

And the matching SQL:

declare @entityType varchar(255) = 'Customers'
declare @entityId int = 0
declare @dateFilterBeg datetime = GETDATE()

SET @dateFilterBeg = (SELECT [Value] FROM [ProgramSettingValues] WHERE [Name]='AS Date Filter Beg')

IF @dateFilterBeg = ''
 BEGIN
  SET @dateFilterBeg = '2000-01-01'
END
--SET @dateFilterBeg = @dateFilterBeg + 'T00:00:00.000'

--declare @entityName varchar(255) = ''
--declare @accountId int = 0
--declare @accountName varchar(255) = ''

SET @entityId = (SELECT [Value] FROM [ProgramSettingValues] WHERE [Name]='AS Entity Id')
--SET @entityName = (SELECT [Name] FROM [Entities] WHERE [Id]=@entityId)

--SET @accountId = (SELECT [AccountId] FROM [Entities] WHERE [Id]=@entityId)
--SET @accountName = (SELECT [Name] FROM [Accounts] WHERE [Id]=@accountId)

--UPDATE [ProgramSettingValues] SET [Value]=@entityName WHERE [Name]='AS Entity Name'
--UPDATE [ProgramSettingValues] SET [Value]=@accountId WHERE [Name]='AS Account Id'
--UPDATE [ProgramSettingValues] SET [Value]=@accountName WHERE [Name]='AS Account Name'

declare @txcount int = 0
declare @i int = 1
declare @balance decimal(7,2) = 0.00

declare @tbl_tx table (
[Id]   INT IDENTITY(1,1) NOT NULL
, [TxDate] Datetime null
, [TicketId] int null
, [TicketNo] int null
, [Description] varchar(255) null
, [Amount] decimal(6,2) null
, [Balance] decimal(7,2) null
)

INSERT INTO @tbl_tx ([TxDate], [TicketId], [TicketNo], [Description], [Amount], [Balance])
--SELECT TOP 1 @entityId as [Date], @entityName as [TicketId], ' ' as [TicketNo], @accountId as [Desc], @accountName as [Amount] FROM [Entities]
--UNION

SELECT
 tv.[Date] as [Date]
,tkt.[Id] as [TicketId]
,CASE
  WHEN tkt.[TicketNumber]>0 Then tkt.[TicketNumber]
  ELSE d.[Id]
 END as [TicketNo]
,CASE
  WHEN [Credit] > 0 Then 'Payment [' + d.[Name] + '] ' + tx.[Name]
  WHEN [Debit] > 0 Then 'Purchase'
 END as [Desc]
,[Debit]-[Credit] as [Amount]
,0 as [Balance]

FROM [AccountTransactionValues] tv
LEFT JOIN [AccountTransactions] tx on tx.[Id] = tv.[AccountTransactionId]
LEFT JOIN [AccountTransactionDocuments] d on d.[Id] = tv.[AccountTransactionDocumentId]
LEFT JOIN [AccountTransactionTypes] tt on tt.[Id] = tv.[AccountTransactionTypeId]
-- Accounts
LEFT JOIN [AccountTypes] at on at.[Id] = tv.[AccountTypeId]
LEFT JOIN [Accounts] a on a.[Id] = tv.[AccountId]
-- Ticket
LEFT JOIN [Tickets] tkt on tkt.[TransactionDocument_Id] = d.[Id]
LEFT JOIN [TicketEntities] te on te.Ticket_Id = tkt.[Id] and te.[EntityTypeId] IN (SELECT [Id] FROM [EntityTypes] WHERE [Name]=@entityType)
-- Entity
LEFT JOIN [Entities] e on e.[Id] = te.[EntityId]
LEFT JOIN [EntityTypes] et on et.[Id] = e.[EntityTypeId]

WHERE 1=1
--AND tv.[AccountId] in (SELECT TOP 1 [AccountId] FROM [Entities] WHERE [Name] = @entityName)
AND tv.[AccountId] in (SELECT TOP 1 [AccountId] FROM [Entities] WHERE [Id] = @entityId)
AND tv.[Date] >= @dateFilterBeg

ORDER BY [Date] ASC

SELECT @txcount = count([Id]) FROM @tbl_tx

WHILE @i<=@txcount
BEGIN
SET @balance = @balance + (SELECT [Amount] FROM @tbl_tx WHERE [Id]=@i)
UPDATE @tbl_tx SET [Balance] = @balance WHERE [Id]=@i
IF @balance = 0 UPDATE [ProgramSettingValues] SET [Value]=(SELECT [TxDate] FROM @tbl_tx WHERE [Id]=@i) WHERE [Name]='AS Entity Date_ZeroBalance'
SET @i = @i + 1
END

select [TxDate], [TicketId], [TicketNo], [Description], [Amount], [Balance] from @tbl_tx ORDER BY [Id] DESC
4 Likes

That did the trick. Thanks for your help!