Create Entity with an ACN Button and add Information to Custom Data field?

:rofl: no comment I didn’t see too! :man_facepalming:

There is a saying in German:
“You can’t see the forest for the trees” :grin:

Now it works thank you!

I have another question, i have in the same entity a custom field “RUC/CI” and when i put there a value like 1234567-8 then in samba shows an errer like this:

[Exception Info 1]

Top-level Exception
Type: System.ArgumentOutOfRangeException
Message: El valor agregado o eliminado da como resultado un campo DateTime que no se puede representar.
Nombre del parámetro: value
Source: mscorlib
Stack Trace: en System.DateTime.AddTicks(Int64 value)
en System.DateTime.Add(Double value, Int32 scale)
en Samba.Infrastructure.Helpers.DateFuncParser.UpdateDate(DateTime date, String expression, Int32 quantity)
en Samba.Infrastructure.Helpers.DateFuncParser.ExecuteDateExpression(String expression, String currentValue)
en Samba.Infrastructure.Helpers.DateFuncParser.Parse(String expression, String currentValue)
en Samba.Domain.Models.Entities.Entity.SetCustomData(String fieldName, String value)
en Samba.Services.ActionProcessors.EntityModule.CreateEntity.Process(ActionData actionData, RuleExecutionContext context) en C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\ActionProcessors\EntityModule\CreateEntity.cs:línea 56
en Samba.Services.Common.RuleActionTypeRegistry.ProcessAction(String actionType, ActionData actionData, RuleExecutionContext context) en C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Common\RuleActionTypeRegistry.cs:línea 39
en Samba.Services.Implementations.AutomationModule.AutomationService.ProcessAction(String actionType, ActionData actionData, RuleExecutionContext context) en C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\AutomationModule\AutomationService.cs:línea 42
en Samba.Services.Implementations.AutomationModule.ActionDataBuilder.<>c__DisplayClass13_0.b__0() en C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\AutomationModule\ActionDataBuilder.cs:línea 76
en System.Windows.Threading.Dispatcher.Invoke(Action callback, DispatcherPriority priority, CancellationToken cancellationToken, TimeSpan timeout)
en System.Windows.Threading.Dispatcher.Invoke(Action callback)
en Samba.Services.Implementations.AutomationModule.ActionDataBuilder.InvokeWith(AppState appState, RuleExecutionContext context) en C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\AutomationModule\ActionDataBuilder.cs:línea 84
en Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWithoutLogging(Object ruleData) en C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\AutomationModule\RuleExecutor.cs:línea 125
en Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWith(Object dataParameter) en C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\AutomationModule\RuleExecutor.cs:línea 62
en Samba.Services.Implementations.AutomationModule.NotificationService.NotifyEvent(String eventName, Object dataParameter, AppState appState) en C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\AutomationModule\NotificationService.cs:línea 26
en CallSite.Target(Closure , CallSite , INotificationService , String , Object , AppState )
en Samba.Services.Implementations.AutomationModule.CommandExecutionService.ExecuteAutomationCommand(AppState appState, String commandName, String commandValue, Object dataObject, Boolean background) en C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\AutomationModule\CommandExecutionService.cs:línea 78
en CallSite.Target(Closure , CallSite , ICommandExecutionService , AppState , String , String , Object , Boolean )
en Samba.Services.ActionProcessors.AutomationModule.ExecuteAutomationCommand.Process(ActionData actionData, RuleExecutionContext context) en C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\ActionProcessors\AutomationModule\ExecuteAutomationCommand.cs:línea 36
en Samba.Services.Common.RuleActionTypeRegistry.ProcessAction(String actionType, ActionData actionData, RuleExecutionContext context) en C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Common\RuleActionTypeRegistry.cs:línea 39
en Samba.Services.Implementations.AutomationModule.AutomationService.ProcessAction(String actionType, ActionData actionData, RuleExecutionContext context) en C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\AutomationModule\AutomationService.cs:línea 42
en Samba.Services.Implementations.AutomationModule.ActionDataBuilder.<>c__DisplayClass13_0.b__0() en C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\AutomationModule\ActionDataBuilder.cs:línea 76
en System.Windows.Threading.Dispatcher.Invoke(Action callback, DispatcherPriority priority, CancellationToken cancellationToken, TimeSpan timeout)
en System.Windows.Threading.Dispatcher.Invoke(Action callback)
en Samba.Services.Implementations.AutomationModule.ActionDataBuilder.InvokeWith(AppState appState, RuleExecutionContext context) en C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\AutomationModule\ActionDataBuilder.cs:línea 84
en Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWithoutLogging(Object ruleData) en C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\AutomationModule\RuleExecutor.cs:línea 125
en Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWith(Object dataParameter) en C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\AutomationModule\RuleExecutor.cs:línea 62
en Samba.Services.Implementations.AutomationModule.NotificationService.NotifyEvent(String eventName, Object dataParameter, AppState appState) en C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\AutomationModule\NotificationService.cs:línea 26
en CallSite.Target(Closure , CallSite , INotificationService , String , Object , AppState )
en Samba.Services.Implementations.AutomationModule.CommandExecutionService.ExecuteAutomationCommand(AppState appState, String commandName, String commandValue, Object dataObject, Boolean background) en C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\AutomationModule\CommandExecutionService.cs:línea 78
en CallSite.Target(Closure , CallSite , ICommandExecutionService , AppState , String , String , Object , Boolean )
en Samba.Services.ActionProcessors.AutomationModule.ExecuteAutomationCommand.Process(ActionData actionData, RuleExecutionContext context) en C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\ActionProcessors\AutomationModule\ExecuteAutomationCommand.cs:línea 36
en Samba.Services.Common.RuleActionTypeRegistry.ProcessAction(String actionType, ActionData actionData, RuleExecutionContext context) en C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Common\RuleActionTypeRegistry.cs:línea 39
en Samba.Services.Implementations.AutomationModule.AutomationService.ProcessAction(String actionType, ActionData actionData, RuleExecutionContext context) en C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\AutomationModule\AutomationService.cs:línea 42
en Samba.Services.Implementations.AutomationModule.ActionDataBuilder.<>c__DisplayClass13_0.b__0() en C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\AutomationModule\ActionDataBuilder.cs:línea 76
en System.Windows.Threading.Dispatcher.Invoke(Action callback, DispatcherPriority priority, CancellationToken cancellationToken, TimeSpan timeout)
en System.Windows.Threading.Dispatcher.Invoke(Action callback)
en Samba.Services.Implementations.AutomationModule.ActionDataBuilder.InvokeWith(AppState appState, RuleExecutionContext context) en C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\AutomationModule\ActionDataBuilder.cs:línea 84
en Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWithoutLogging(Object ruleData) en C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\AutomationModule\RuleExecutor.cs:línea 125
en Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWith(Object dataParameter) en C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\AutomationModule\RuleExecutor.cs:línea 62
en Samba.Services.Implementations.AutomationModule.NotificationService.NotifyEvent(String eventName, Object dataParameter, AppState appState) en C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\AutomationModule\NotificationService.cs:línea 26
en Samba.Presentation.Services.Implementations.AutomationModule.NotificationClient.NotifyEvent(String eventName, Object dataObject)
en CallSite.Target(Closure , CallSite , INotificationClient , String , Object )
en Samba.Presentation.ClientLibrary.Modules.PosModule.TicketViewModel.ExecuteAutomationCommand(String automationCommandName, String automationCommandValue, String nextCommandValue, Object dataObject, Boolean executeOnce, Boolean clearSelection) en C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Presentation.ClientLibrary\Modules\PosModule\TicketViewModel.cs:línea 329
en Samba.Presentation.ClientLibrary.Modules.PosModule.TicketViewModel.ExecuteAutomationCommand(AutomationCommand automationCommand, Object dataObject, String selectedValue, String nextValue) en C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Presentation.ClientLibrary\Modules\PosModule\TicketViewModel.cs:línea 289
en Samba.Presentation.ClientLibrary.Modules.PosModule.TicketViewModel.OnExecuteAutomationCommand(CommandContainerButton obj) en C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Presentation.ClientLibrary\Modules\PosModule\TicketViewModel.cs:línea 274
en Microsoft.Practices.Prism.Commands.DelegateCommand`1.<>c__DisplayClass6.<.ctor>b__2(Object o)
en Microsoft.Practices.Prism.Commands.DelegateCommandBase.Execute(Object parameter)
en Microsoft.Practices.Prism.Commands.DelegateCommandBase.System.Windows.Input.ICommand.Execute(Object parameter)
en MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
en System.Windows.Controls.Primitives.ButtonBase.OnClick()
en System.Windows.Controls.Button.OnClick()
en System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
en System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
en System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
en System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
en System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
en System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
en System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
en System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
en System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
en System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
en System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
en System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
en System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
en System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
en System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
en System.Windows.Input.InputManager.ProcessStagingArea()
en System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
en System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
en System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
en System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
en System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
en MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
en MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
en System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
en System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)


[Assembly Info]

mscorlib, Version=4.0.0.0
System, Version=4.0.0.0
Samba.Services, Version=5.3.7390.41537
Samba.Domain, Version=5.3.7390.41536
Samba.Infrastructure.Data, Version=5.3.7390.41536
System.ComponentModel.Composition, Version=4.0.0.0
Samba.Presentation.Services, Version=5.3.7390.41539
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.3.7390.41533
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.3.7390.41536
Stateless, Version=1.0.0.0
PropertyTools, Version=2012.4.14.1
Samba.Localization, Version=5.3.7390.41534
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

Captura

it looks like a date time error but i didnt setup it like a date …

not sure on that. As you say looks like a date error.
Whats your system date format?
Have existing entities? Maybe try removing field and adding again.

1 Like

like its showing in the picture is my date format

i change the type to number but it seems theres no diference

This seems to be the same issue that was posted in

For some reason, when a string contains a ‘+’ or ‘-’ the underlying code is trying to convert it to a date.

1 Like

Hello @Memo yes that’s right but no solution atm?

You can try just putting numbers and using a mask to insert the characters.

Try adding a letter prefix. Made some fields with- the other day and didn’t hit this issue, those fields had value like KAH-101

None that I’m aware of. Use the mask workaround Jesse mentioned for the time being.
I do the same for our tax numbers:
2020-07-12_02;09_1594541386_Samba.Presentation

1 Like

I think this is a Microsoft issue. It does the same thing in other Microsoft apps. I think the framework we use is causing it. I will add it to our Redmine tracker.

Hello @Jesse the problem is that the number sometimes is longer or shorter but the end will always be the same. Like 1234567-8 or 12345678-9

You can set a mask for that.

And how it can be done?

How would this be set it up
Captura
it works like -0 but i need 0000000-0 for example
i need at least 7, 8 or 9 digits befor that…

I think our problem is we do not have the ability to turn on Right to Left matching. Can you change your number format so its

That would output 1-23423423 or 2-234234 for example.

Be sure and set Mask Type to Regex

thanks @Jesse but thats not working for me i will think how to do that… its a special number here in my country with a “-#” at final.

But can y show on a printer template it this way? ########-# with 7,8 or 9 digits before?

Try this:

image

See if it doesnt convert it to date.

That should allow you to use the - and it wont convert to date.

could you prefix with a letter behind the scenes since your using ?prompt
And then slice the letter off on print template if needed?