Using pre/post save helper with Pick columns
Can anyone show me an example of how to set pick column(releated to other pod) using a pre/post save helper. Thanks in advance
4 Answers
<?php $columns['column_name_here']['value'] = 4; // this will set the pick column value to the related pod item of ID 4
hey scott consider this example, the persons pod & the dates pod have a multiselect column each defined in them which is bidirectional to each other
person pod --> date(multiselect pick column) date pod --> person(multiselect pick column)
as of now i know the date ids that are created so just entering them manually in the pick field value for the multiselect
but this is not happening my syntax & code maybe wrong so lookin for help there
$api = new PodAPI();
$columns['name'] = testing1234;
$columns['date']['id'] = array(1,2);
$params = array('datatype' => 'persons', 'columns' => $columns);
$id = $api->save_pod_item($params);
Generally i though of fetching the date pod id's & then using them for the above code. what if i enter a id for the date pod which does not exist as a pod item, will it be created by itself like is there a way to do that that if the pod item does not exist then create it n them associate the respective id for the above relation?
please could you help me with the code thanks!
Try this:
$api = new PodAPI();
$columns['name'] = testing1234;
$columns['date']['value'] = '1,2';
$params = array('datatype' => 'persons', 'columns' => $columns);
$id = $api->save_pod_item($params);
edited Sep 21 '10 at 1:40
Scott I played around a little it works this way thanks, for your help! tc
$api = new PodAPI();
$columns['name'] = testing1234;
$columns['date'] = "1,2";
$params = array('datatype' => 'persons', 'columns' => $columns);
$id = $api->save_pod_item($params);
edited Sep 21 '10 at 8:06


