July 13, 20169 yr Hello! Another post... Please help me out. I am trying to create an array from a value list within Filemaker Pro (Using PHP API) The idea is to create an array of names from a value list I have set up... Then put them into an option tag. e.g. $staff = array(FileMaker Value List) ^^ I know that's incorrect, but it shows what I want to do Then with that array I want to be able to Create a HTML option list (I know how I would do that) --- I am just really struggling with creating the array... Here is what I have $database = "comms__web"; $hostname = "###.###.#.#"; $username = "web"; $password = "################"; $layoutname = "Web"; $valueListName = "MIS"; //CREATE FILEMAKER OBJECT $fm = new FileMaker($database, $hostname, $username, $password); //GET THE LAYOUT AS AN OBJECT. $layoutObject = $fm->getLayout($layoutName); //GET THE VALUE LIST $valueList = $layoutObject->getValueList($valueListName); However it doesn't actually appear to pick up the list... Please help me out Thanks, Edited July 13, 20169 yr by Jack Wright
July 13, 20169 yr You could inspect what is returned on the layout with print_r($layoutObject) and see what is in there. The value list must be associated with the field on that particular layout. And what version of FMS are you working with? I believe that function may also be deprecated. Have you tried getValueListTwoFields instead?
July 13, 20169 yr Author 25 minutes ago, Mike Duncan said: You could inspect what is returned on the layout with print_r($layoutObject) and see what is in there. The value list must be associated with the field on that particular layout. And what version of FMS are you working with? I believe that function may also be deprecated. Have you tried getValueListTwoFields instead? I am using FMS 14 Additionally The layout has a field on it with the valuelist assigned to it. Nothing showed up with the print_r
July 13, 20169 yr Seems like you are missing the FIELD object: //CREATE FILEMAKER OBJECT $fm = new FileMaker($database, $hostname, $username, $password); //GET THE LAYOUT AS AN OBJECT. $layoutObject = $fm->getLayout($layoutName); $fieldName = "your_field_name'; //GET THE FIELD FROM LAYOUT AS AN OBJECT $fieldObject = $layoutObject->getField($fieldName); //GET THE VALUE LIST ATTACHED TO THIS FIELD $valueList = $fieldObject->getValueList(); // FOR TESTING echo "<pre>"; print_r($valueList); echo "</pre>"; Good luck!
July 15, 20169 yr Author On 7/13/2016 at 4:54 PM, dwdata said: Seems like you are missing the FIELD object: //CREATE FILEMAKER OBJECT $fm = new FileMaker($database, $hostname, $username, $password); //GET THE LAYOUT AS AN OBJECT. $layoutObject = $fm->getLayout($layoutName); $fieldName = "your_field_name'; //GET THE FIELD FROM LAYOUT AS AN OBJECT $fieldObject = $layoutObject->getField($fieldName); //GET THE VALUE LIST ATTACHED TO THIS FIELD $valueList = $fieldObject->getValueList(); // FOR TESTING echo "<pre>"; print_r($valueList); echo "</pre>"; Good luck! Thank You! Will try this out when I am next on the computer!
Create an account or sign in to comment