add value on insert
add value on insert
After selecting a customer on the customerSearch page, the user is brought to another page customerDetail.php?id=3 (where the id is the customer id). On customerDetail I have a data table that shows appointments for that customer. It is filtering correctly so it is only showing appointments for customerID=3. However, when the user adds an appointment, the record is currently getting added with a null in the CustomerID field. I need the CustomerID field in this new record to automatically be populated with the CustomerID (3 in this example), which I have stored in a variable. How do I do this?
This question has an accepted answers - jump to answer
Answers
Hi,
I replied to your e-mail version of this question a little while ago, but for completeness and incase anyone else finds this thread and is interested, I'll reply here as well.
It sounds like you want to make use of the
Field->setValue()
method:Allan
Perfect: Line 6 is what I needed.