January 25, 20169 yr I would like to edit a value list via a web interface- I have done this using a field ("Use values from field"), but that [I incorrectly assumed, see doughemi's suggestion below!] requires adding/editing a record for each value, while (if possible) the textarea box would allow the editing of the whole value list at once. Genx showed how to display a value list... $layout = $fm->getLayout('my_template'); $list = array_map("htmlentities",(array)$layout->getValueList('my_list')); I am hoping there is some easy way to send back an edited valuelist… We are using Filemaker Server 11 (not advanced). Thanks in advance! Edited January 26, 20169 yr by Dave Carmean
January 25, 20169 yr Your values do not necessarily need to be in separate records. You can use a field in one record with a return-delimited list of values to create a value list. I use a one-record utility table for things like this. Your php code would look something like this: $layout = $fm->getLayout('YourLayout'); $list = array_map("htmlentities",(array)$layout->getValueList('YourValueList')); $newlist = $list; // //modify your $newlist array here // //convert the array to a return-delimited string $newString = implode("\n",$newlist ); // now upload it to the database in a field named "vlfield" in utility table named "yourUtilityTable" $getstuff = $fm->newFindAllCommand('yourUtilityTable'); $result = $getstuff->execute(); $records = $result->getRecords(); $myRecord = $records[0]; $myRecID = $myRecord->getRecordId(); $sendNewVL = $fm->newEditCommand('yourUtilityTable', $myRecID); $sendNewVL -> setField('vlfield', $newString); $result2 = $sendNewVL->execute(); //return-delimited list is now in vlfield. Use the values from vlfield to create your value list.
January 26, 20169 yr Author So simple that I completely missed the possibility. That is very, very convenient. I appreciate your help. Thank you for your time!
Create an account or sign in to comment