syntax to concatenate existing field value using server side events please
syntax to concatenate existing field value using server side events please
I have a postEdit event which calls a function to update a database table like so...
function editPatronPayment ( $db, $id, $values ) {
$today = date("Y-m-d");
$itemid = $values['tblorderdetails']['DetailItemID'];
$db->push( 'tblitem',
array(
'Donated' => '1',
'ItemNotes' => 'Item Marked as Donated on '.$today.' as it was returned after the Patron Payment was made'
),
array(
'ItemID' => $itemid
)
);
}
i want to change the ItemNotes field update - so the note is appended to the existing value rather than overwriting it
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Don't you need pre- rather than post- Edit?
i am using post edit so that the related table is not affected unless the edit is completed.
the code posted above works as is, its just that i lose any pre-existing value of the item notes field
Docs definition of postEdit:
I must be missing something. Are you saying "update table A, then do something to table B"?
Yes, in answer to "update table A, then do something to table B"?
the table being edited in editor is tblorderdetails (table A)
the table being edited as a postEdit event is tblitem (table B )
Previous comment incorrectly marked as Answer
It clarifies my scenario, but it doesn't address the original question