update a record from an other table in a JavaScript Button

Hi. I have a problem in a form application. I need to update a record in a table that is not the one of the form. And I have to do it from a JavaScript Button. Anybody knows how I can do it? Please, an example would be grate. Thank you

Not sure why you should want to use a javascript button. You could use an ajax buttton, then it’s just a piece of php.

Thank you Aducom. You’r grate ! It works perfect. This Ajax Buttons are new. I’m learning with you.
But, now, I’ll need to execute the javascript method I had in my old javascript Button.
I had this code in my Javascript Button:

var caal = [wcaal]+1;
guiones1(caal);

How can I put this in an Ajax Button?

Thank you for your help

If guiones1 is a JS function, you can use sc_ajax_javascript() macro to call it from PHP.

sc_ajax_javascript("guiones1",array([wcaal]));