How to save data in a new column with Post-save helper?
Hello everyone,
I'm having troubles with post-save helper. I have a date column and I want to save a year of that date in a separate column, say "year". However, I can't find any examples with such case and can't figure out by myself how to do it :(
Would really appreciate if anyone can help me with the code.
Many thanks, Dasha
3 Answers
>Also, I'm not sure which helper to use pre-save or post-save :S
you don't need to save pod twice, so it's better to use pre-save
>Do I have to have column "year" declared in the Pod?
$columns['year']['value'] stands for column you need to fill out with year value - if it has another name, just change 'year' to that name
$column['date']['value'] (i guess it should be $columns) stands for initial date column with 'date' name
edited Sep 10 '10 at 8:37
something like this should help -
$date = $column['date']['value']; $year = substr($date,0,4); $columns['year']['value']=$year;
@Ayush, this doesn't seem to work :( Do I have to have column "year" declared in the Pod? If I do, then it shows up in the add/edit Pod form and I don't want it there.
Also, I'm not sure which helper to use pre-save or post-save :S


