Hi,
I have a button on grid of list page.
This is my button instructions: -
- Client before
ctrl.setMessage("Sending request to server...");
- Server (and this is where I'm battling)
IF ($values["V1"]==0) { //instruction or condition to update table then follow through
global $dal;
$record = $button->getCurrentRecord(); //this is the button being clicked on list grid & I'm sure it's confusing the entire process
if ($record["ID"])
{
$Stock = $dal->Table('Stock');
$Stock->Param['ID'] = $record['SID1'];
$Stock->Value['Stock_on_Hand'] = ($record['CSOH1'] + $record['T1']);
$Stock->Update();
}
}
else
{
// do nothing
}
$result["txt"] = $params["txt"]."Updated !!!!! ";
- Client After
var message = result["txt"];
ctrl.setMessage(message);
The problem I'm experiencing is when clicking the button it still updates the table irrespective of the condition.
Thanks
I have a button on grid of list page.
This is my button instructions: -
- Client before
ctrl.setMessage("Sending request to server...");
- Server (and this is where I'm battling)
IF ($values["V1"]==0) { //instruction or condition to update table then follow through
global $dal;
$record = $button->getCurrentRecord(); //this is the button being clicked on list grid & I'm sure it's confusing the entire process
if ($record["ID"])
{
$Stock = $dal->Table('Stock');
$Stock->Param['ID'] = $record['SID1'];
$Stock->Value['Stock_on_Hand'] = ($record['CSOH1'] + $record['T1']);
$Stock->Update();
}
}
else
{
// do nothing
}
$result["txt"] = $params["txt"]."Updated !!!!! ";
- Client After
var message = result["txt"];
ctrl.setMessage(message);
The problem I'm experiencing is when clicking the button it still updates the table irrespective of the condition.
Thanks
