# Help is needed with Set Widget Value action

**URL:** <https://forum.sambapos.com/t/help-is-needed-with-set-widget-value-action/2789>\
**Category:** V4 Question\
**Created:** [September 28, 2014, 9:44pm UTC](https://forum.sambapos.com/t/help-is-needed-with-set-widget-value-action/2789 "2014-09-28T21:44:00Z")\
**Posts on this page:** 12\
**Page:** 5

<div class="post-metadata">

**Author:** ![emre](https://forum.sambapos.com/user_avatar/forum.sambapos.com/emre/32/39073_2.png) [@emre](https://forum.sambapos.com/u/emre)\
**Post date:** [October 2, 2014, 3:20am UTC](https://forum.sambapos.com/t/help-is-needed-with-set-widget-value-action/2789/81 "2014-10-02T03:20:33Z")

</div>

Update 2: I’ve added three js functions that can be run inside browser widget so your webapps can execute SambaPOS functions.

```
window.external.ExecuteAutomationCommand(<CommandName>,<CommandValue>);
window.external.GetSettingValue(<SettingName>);
window.external.SetSettingValue(<SettingName>,<SettingValue>);

```

I hope @JohnS notice that 🙂

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [October 2, 2014, 3:21am UTC](https://forum.sambapos.com/t/help-is-needed-with-set-widget-value-action/2789/82 "2014-10-02T03:21:52Z")

</div>

Wait a minute… so your saying the apps can execute Samba functions? As in I can control Samba through them as well as other way around? Is it possible to pass a value from the webapp as a CommandValue ?

---

<div class="post-metadata">

**Author:** ![emre](https://forum.sambapos.com/user_avatar/forum.sambapos.com/emre/32/39073_2.png) [@emre](https://forum.sambapos.com/u/emre)\
**Post date:** [October 2, 2014, 3:29am UTC](https://forum.sambapos.com/t/help-is-needed-with-set-widget-value-action/2789/83 "2014-10-02T03:29:07Z")

</div>

If it runs in browser widget… Yes.

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [October 2, 2014, 3:30am UTC](https://forum.sambapos.com/t/help-is-needed-with-set-widget-value-action/2789/84 "2014-10-02T03:30:51Z")

</div>

Holy cow I have had this idea for a while now I just thought it was going to be nearly impossible so Ive held back on requests… But now it suddenly all seems possible. It may take me a while to build it… but this means I can do some very advanced integration with TimeTrex. I can not wait to try this.

This fits perfect with my Employee entity design as well. Lots of cool stuff I can do to control those entities now.

Using the AHK method I already have built a few test functions. I have tested successfully making it check an Entity name when Time Clock is pressed to view the TimeTrex web app… it logs that specific entity into TimeTrex automatically. Its working great… my next test is automating TimeTrex to pull up specific Entities schedule…

---

<div class="post-metadata">

**Author:** ![pizzaeilat4](https://forum.sambapos.com/user_avatar/forum.sambapos.com/pizzaeilat4/32/461_2.png) [@pizzaeilat4](https://forum.sambapos.com/u/pizzaeilat4)\
**Post date:** [October 2, 2014, 1:42pm UTC](https://forum.sambapos.com/t/help-is-needed-with-set-widget-value-action/2789/85 "2014-10-02T13:42:16Z")

</div>

dear @QMcKay,  
I found the name of the enter button, but the Web page do not agree pressing enter to enter the site ☹ and it displays an error message **That username and Password is not correct**  
it enter only with a mouse click  
It is possible to add a command button for mouse click?  
of course It’s fine without it but if there is a way I’d love to.  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [October 2, 2014, 2:31pm UTC](https://forum.sambapos.com/t/help-is-needed-with-set-widget-value-action/2789/86 "2014-10-02T14:31:38Z")

</div>

@pizzaeilat4, this should do it - just replace login-button with the name of the button you found…

```
page.Document.getElementById("login-button").Click()
```

---

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [October 2, 2014, 2:34pm UTC](https://forum.sambapos.com/t/help-is-needed-with-set-widget-value-action/2789/87 "2014-10-02T14:34:25Z")

</div>

@emre, excellent features - quite powerful. We might be able to do away with AHK altogether in this case!

---

<div class="post-metadata">

**Author:** ![pizzaeilat4](https://forum.sambapos.com/user_avatar/forum.sambapos.com/pizzaeilat4/32/461_2.png) [@pizzaeilat4](https://forum.sambapos.com/u/pizzaeilat4)\
**Post date:** [October 2, 2014, 2:57pm UTC](https://forum.sambapos.com/t/help-is-needed-with-set-widget-value-action/2789/88 "2014-10-02T14:57:37Z")

</div>

> [@QMcKay](#):
>
> @pizzaeilat4, this should do it - just replace login-button with the name of the button you found…

 ![](https://forum.sambapos.com/uploads/default/original/3X/0/c/0c4c5fbb98bd62cd5f86173a33962c88b6cf5bfd.png)

It’s not so bad.  
Even so, that’s fine, thank you very much 😃

---

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [October 2, 2014, 4:04pm UTC](https://forum.sambapos.com/t/help-is-needed-with-set-widget-value-action/2789/89 "2014-10-02T16:04:57Z")

</div>

@pizzaeilat4, try this instead of Click or Submit:

```
page.Document.getElementById("password").focus()
Send, {Enter}
```

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [October 2, 2014, 4:08pm UTC](https://forum.sambapos.com/t/help-is-needed-with-set-widget-value-action/2789/90 "2014-10-02T16:08:38Z")

</div>

It is a button but its not a button image from what I can tell it is a Text button… not sure what that means…

EDIT: Try

```
page.Document.getElementById("x-btn-click").Click()

```

EDIT: Nevermind I see that you got it working it was just not sending the right password

I am curious if you made sure you typed right password and login ? I am sure you did just thought I would double check.

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [October 2, 2014, 4:56pm UTC](https://forum.sambapos.com/t/help-is-needed-with-set-widget-value-action/2789/91 "2014-10-02T16:56:49Z")

</div>

I noticed you released these features with 4.1.63 today. I am going to play around with them. I like AHK but if I can do same thing internally without having to start process for a script and or call other libraries that would be great!

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [October 2, 2014, 7:12pm UTC](https://forum.sambapos.com/t/help-is-needed-with-set-widget-value-action/2789/92 "2014-10-02T19:12:03Z")

</div>

TimeTrex uses a lot of JS I am playing around with the new functions. So far I have not gotten it to work yet but it looks like I may be able to access/control almost every aspect of TimeTrex and even pass values from TimeTrex all within SambaPOS. I may be able to make it almost as if TimeTrex is just part of SambaPOS.

Example would be instead of navigating TimeTrex from within the widget I could navigate it and perform functions with command buttons from SambaPOS and use some of the results with my Employee Entities to do some neat stuff. Instead of using (ENTITY STATE MINUTES:X} like I showed in a screenshot while back I could actually pull real data from the actual time clock as a command value and inject that command value to display in the Question portion of my ask question popup.

Hopefully I am smart enough to figure this all out haha.

[Previous page](https://forum.sambapos.com/t/help-is-needed-with-set-widget-value-action/2789.md?page=4)
