[Task Widget Tutorial] 1. Creating a to-do list

:running: You need to install at least 5.1.51 version

##What is a Task?
If you’re using SambaPOS for a while you’ve probably wondered how you can use Task feature. A Task is a general purpose to-do like informational data that is useful to manage things we need to keep track of. We need to create a Task Type for each specific use case. For example if we need to create a todo list and another list to track utility bills we can create separate task types to separate these lists. Task Widgets used for displaying task lists.

:bulb: Task Widgets are shared across terminals. All users that have permission to access task widget will see all task updates. You need to setup message server to update widgets instantly. So it is possible to use Task Widget as a nice communication tool.

##Creating a Simple To-Do List

In this tutorial I’ll show creating a simple to-do list. First I need to create a new Task Type.

We can also define Custom fields for tasks here. For example if we want to track utility bills we can create a custom field for tracking due date and use that field on reporting. For now I’m leaving it empty.

On next step I’ll create a Custom Entity Screen to create a screen for displaying todo items.

I need to add a mapping to enable this screen.

I’ve set visibility setting as POS so this entity screen won’t appear while setting / changing entities for tickets.

After saving Entity Screen I’ll switch to POS screen and add a new Task Editor widget on ToDo List screen.

:bulb: To add a widget right click on screen, switch to Design Mode (Shift + Ctrl +D) and from right click menu add a new Task Editor. Disable Design Mode to save your changes.

While you’re on Design Mode right click on widget and click Settings to display widget settings.

To define task type select a task type from list. After setting it scroll down to Task Commands setting.

Select All and Complete commands are pre-defined commands that will appear under task list. Select All button highlights all tasks and Complete button marks highlighted tasks as completed.

:bulb: Complete command marks a task as completed but does not restores a completed task as uncompleted. If you need that functionality you can use Toggle command instead.

Disable Design Mode from right click menu to see your updates.

:bulb: When you disable design mode you you’ll see borderless transparent background instead of that white background border. I’ve added a Label Widget behind Task Editor to draw that border but I’m skipping that step for keeping tutorial short.

On top of the widget there is an editor to add tasks. I can type something and press enter to add a new todo task.

Selecting a task and clicking Complete button will mark task as completed.

:bulb: Completing a task will move task to end of the list with dimmed font color. Completed tasks stays there until we end work period. Ending work period removes completed tasks from list.

4 Likes

Ok, in SambaPOS 5.1.54 I was able to make an automatic task “that certain a room needs to be cleaned” using this fix:

(I really love the things that Sambpos can do with customisation)

But now the next thing; Feedback from a task; in my case setting the Entity back to it’s State, which in my case involves setting some customfields for the Entity and the state. For this i already have a rule and an automation command. But the it seems to me that the “Task create commands”, “Task complete commands” and “Task Commands” are something different as an Automation command.

What are those 3 fields? “Task create commands”, “Task complete commands” and “Task Commands”, What kind of input is valid and executed over there?

Thanks in advance.

Task Create commands:

When the task is initially created, any Automation Commands listed in this box will fire.

Task Complete commands:

When the task is marked as Complete, any Automation Commands listed in this box will fire.

Task Commands:

These are pre-defined, and they cannot be modified. For any of the pre-defined commands that you list here, a button will appear at the bottom of the Task Editor Widget. The 3 pre-defined commands are:

Select All
Toggle
Complete

You may change the appearance of the buttons, using this syntax:

buttonHeader=CommandName:CommandValue
… or …
buttonHeader=CommandName:[Custom Field Name]

For example…

Select all Widgety Task Things on this display=Select All
Flip the completion status of all Tasks=Toggle
Mark Selected Tasks as Completed=Complete
Mark Completed=Complete:SomeValue
Order Served=Complete:[Table] … where Table is a Custom Field Name in the Task Type definition.

Task command syntax is

Header=Command Name:Command Value

or

Header=Command Name:[Custom Field Name]
1 Like

Since updating to 5.1.54 when I select ToDo List entity Screen i get the following error
Object Reference not set to an instance of an object

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

Application: SambaPOS
Version:     5.1.54
Region:      en
DB:          SQ
Machine:     DELL
User:        User
Date:        10/11/2015
Time:        17:52

User Explanation:

User said ""
-----------------------------

[Exception Info 1]

Top-level Exception
Type:        System.NullReferenceException
Message:     Object reference not set to an instance of an object.
Source:      Samba.Modules.TaskModule
Stack Trace: at Samba.Modules.TaskModule.Widgets.TaskEditor.TaskTimeSpanFormatter.AsString(String durationFormat)
   at Samba.Modules.TaskModule.Widgets.TaskEditor.TaskViewModel.GetDuration()
   at Samba.Modules.TaskModule.Widgets.TaskEditor.TaskViewModel.Refresh()
   at Samba.Modules.TaskModule.Widgets.TaskEditor.TaskEditorViewModel.<>c.<Refresh>b__69_7(TaskViewModel x)
   at System.Collections.Generic.List`1.ForEach(Action`1 action)
   at Samba.Modules.TaskModule.Widgets.TaskEditor.TaskEditorViewModel.<Refresh>b__69_0()
   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.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()

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

[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
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
Samba.Persistance, Version=1.0.0.0

Also another error :

The calling thread must be STA, because many UI components require this.
2 Likes