Hi All
i am really stuck, have spent many hours searching for answers and i really need some help.
I have a data object called quote, this has several functions that return a result on the fly, this works well.
The problem i have is 2 parts, Part 1 is creating a new record for the archive, this is triggered by a status id in the quote.
in my quote Dataobject i have the following code.
public function Createarchive()
{
$sid = $this->getStatusID();
if($sid===2)
{
$Archive = Archive::get()->filter(array('QuoteID' => $this->ID));
if (!$Archive) {
$Archive = new Archive();
$Archive->QuoteID = $this->ID;
$Archive->write();
}
}
}
this is not working, iam unsure as to why.
Part 2 is writing the each function result into a field in the archive dataobject, in the archive dataobject there is a field for each function in the quote data object.
i am unsure asto the best way to get the function result and write it to the archive.
any help is appereciated
Thanks