19 June 2014 at 12:03am
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();
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.
20 June 2014 at 10:45pm
Thanks for the quick reply, i finally had time to play around with this some more.
I know that it is getting the status ID as i am using that elsewhere, i had this work once when i had it in onafterwrite function but this screwed something else up.
i don't really know how to test where it is getting to but i would say that if is not getting to the if(!Archive) part wihich would indicate that the
20 June 2014 at 11:03pm
(Last edited: 20 June 2014 11:04pm),
I usually just place an echo "here"; within the if-statement to see if it gets there. It will appear at the top of your screen somewhere :) I'm not sure that (!$Archive) would work, as the query probabely always returns an object, be it empty...
Once again Thanks for your help on this i have managed to get it working, i removed the If Statement checking for the statusID and bingo if an archive doesn't exist then it will create a record for it and with a little fiddling around i have managed to get the function writing to the record.
Sound like this is solved :) nice work, @voodoochile can you edit your original thread to include [solved] at the beginning. It helps others with similar issues know whether a thread is likely to solve their issue too.