SambaPOS 5.2.19 Beta Release

I implemented a handy JS function in Scripting. It allows us to use a simple JS object to create a property editor dialog from it. I’ll primarily use it for displaying an editor for Time Clock Config Task settings but I think we’ll find more uses for it.

function test(){
  var result = dlg.EditDynamic('Test Properties',{UserName:'Emre',Age:13,Certified:true});
  return result.UserName;
}

Also it can be used for JS debugging purposes. We can use it to display contents of a JSON for example…

function test(){
    var products = gql.Exec('{getProducts{name,groupCode,price}}');
    var json = JSON.parse(products);
    dlg.EditDynamic('JSON',json);
    return 'OK';
}

4 Likes

Emre is there a method to update a task from within script? Like GQL method?

1 Like

Oh wow this can become very handly! Especially when it comes to CC integrations!.

By the way, that payment processor module, I have tested it and its working great for manual processing.

How can we use this to implement other CC controllers?

A fresh build of beta release uploaded. Please refer first post.

@VehbiEmiroglu how do I do that… This is a feature I would love to put to use.

Also what is this?:
Combo box selection for dynamic editor added

See few posts above.

Multi select ask question

1 Like

oh i seen that I didnt realize thats what that was. Thanks bud!

He doesnt show the config for multiselect. I dont see any changes in the action on latest update…

Not sure then, would imagine it would either be some adjustment in the buttons field or separate option/field. Said added setting so has to be something within action. If no new field guess it must be some syntax in the buttons field @emre
Perhaps alternate seperator to comma…

Thats what I also assumed.

Don’t you have this?

It is a JS function to display dynamically generated editor screens. I demonstrated it few posts above

1 Like

Here you can see the latest version of Time Clock configuration.

timeclock8.zip (9.6 KB)

3 Likes

I just installed samba on a new pc last night so I know I have the latest. And no I don’t have that. I thought I was going crazy for a second haha. Okay great I’ll test out the time clock too. @VehbiEmiroglu still waiting on open edge module.

Here you can see my latest beta version and no multi select. At first I thought OK button would activate it so I typed it as an option lol

OK sorry for the confusion. Seems like latest release didn’t uploaded properly. We should see 8 Feb on the title as the version date but it is still 4 Feb as seen on @Hasa’s screenshot. We’ll re-upload it on Monday.

2 Likes

@emre the latest time clock version has an error with Get Settings and wont execute. It looks correct like it should work. I wonder did it depend on a feature? the error says the JSON object its trying to access does not exist. I swear Users and Roles were in the GQL already.

Top-level Exception
Type:        Microsoft.ClearScript.ScriptEngineException
Message:     'json.data.roles.length' is null or not an object
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, Object dataObject) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\ExpressionModule\ExpressionEngine.cs:line 170
   at Samba.Services.Implementations.ExpressionModule.ExpressionService.Invoke(String expression, Object dataObject) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\ExpressionModule\ExpressionService.cs:line 37
   at CallSite.Target(Closure , CallSite , IExpressionService , String , Object )
   at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid3[T0,T1,T2](CallSite site, T0 arg0, T1 arg1, T2 arg2)
   at Samba.Presentation.ClientLibrary.Modules.DatabaseModule.ExportHelper.ExecuteJscriptTask(String action, Object dataObject) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Presentation.ClientLibrary\Modules\DatabaseModule\ExportHelper.cs:line 191
   at CallSite.Target(Closure , CallSite , ExportHelper , String , Object )
   at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid3[T0,T1,T2](CallSite site, T0 arg0, T1 arg1, T2 arg2)
   at Samba.Presentation.ClientLibrary.Modules.DatabaseModule.ExportHelper.ExecuteSingleTask(AutoConfigurationTaskItem taskItem, Dictionary`2 keys, Object dataObject) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Presentation.ClientLibrary\Modules\DatabaseModule\ExportHelper.cs:line 157
   at CallSite.Target(Closure , CallSite , ExportHelper , AutoConfigurationTaskItem , Dictionary`2 , Object )
   at System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3)
   at Samba.Presentation.ClientLibrary.Modules.DatabaseModule.ExportHelper.ExecuteTask(AutoConfigurationTask task, Dictionary`2 keys) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Presentation.ClientLibrary\Modules\DatabaseModule\ExportHelper.cs:line 124

Oh sorry for not mentioning that. Yes we need next Monday update to be able to operate timeclock8 configuration.

1 Like

Ok I figured that could be the case. Small and petty and probably not important but config tasks if they fail to load after an error they still say Completed successfully with a dialog box at end of it to acknowledge.

1 Like

I uploaded a fresh build. You can re-download and test it.

3 Likes

A fresh build uploaded.

5 Likes