This topic is locked
[SOLVED]

 Fatal error: Call to undefined method stdClass::Add()

5/15/2014 9:01:59 AM
PHPRunner General questions
A
Anapolis author

Using PHPRUnner 7.1 I am getting the error -- Fatal error: Call to undefined method stdClass::Add() when I try to Edit a Record and Save it.
I am using the documentation regarding using a DAL method to save the current record into another table. I have not used this method until today.

This code is on the Edit Events page for this record.
According to Runner Help this DAL method is only available in 2 pages-- and this is one of them -- the Edit page inside the following function:
function BeforeEdit($values, $where, $oldvalues, $keys, $message, $inline, $pageObject)

"Before Record is Updated"

global $dal;
$tblEvents = $dal->Table("calendarchange");

$tblEvents->Value["change_id"]= NULL;

$tblEvents->Value["id"]=$oldvalues["id"];

$tblEvents->Value["DateField"]=$oldvalues["DateField"];

$tblEvents->Value["Description"]=$oldvalues["Description"];

$tblEvents->Add();
// the error is happening on the line above : $tblEvents->Add()
Sergey Kornilov admin 5/15/2014

DAL is available in all events but you need to make sure that table name is spelled properly and also "calendarchange" table is the part of PHPRunner project.