April 19, 201114 yr Newbies Hello there, I have created some CWP pages for my company and it has been doing great. Recently my boss wants me to changed some of the fields into an optional dropdown menu. I tried to create a value list in FileMaker and the did it this way in PHP: $layoutObject = $fm->getLayout('form_api'); $noheads = $layoutObject->getValueList('nohead'); foreach ( $noheads as $nohead ){ $_SESSION['nohead'] .= "<option>".$nohead."</option>"; } This works perfectly for the valuelists that show all values of a field but when it comes to valuelists that show only related value, it always return the result of the first record. So I modified it and it now looks as follows: $record = $fm->getRecordById( 'form_api' , $_SESSION['ent']); $NoObject = $record->getLayout('form_api'); $cnoheads = $NoObject->getValueList('cnohead'); foreach ( $cnoheads as $cnohead ){ $_SESSION['cnohead'] .= "<option>".$cnohead."</option>"; } I thought it would return the right value this time as I actually got record by id so it should return the values according the to record id but that was not the case. The truth is that it still returns the values related to the first record. Of course I can create a portal and loop through the related sets but there are over 20k records from the table I want to get value from. It sounds stupid looping 20k records to get values for a dropdown menu... Is there any way I can get the correct values using value list? Any help will be greatly appreciated! Lou
April 19, 201114 yr How did you get it to work? I read this yesterday, but didn't understand why the 2nd scenario you mentioned didn't work. wait a min... I just looked at it again. Was it because you were getting the layout object, then getting the value list from the layout, rather than retrieving the value list from the record object?
September 16, 201114 yr I'm stuck on this problem too... I don't see any option to pull the value list from the Record. Hmmm... Cuitw, can you post your solution?
September 16, 201114 yr Figured this one out actually, it was an issue with how the value list was being related to the layout, nothing to do with PHP. Only difference actually is that I'm using the getValueListTwoFields instead of getValueList
Create an account or sign in to comment