doujiao7520 2014-06-18 15:53
浏览 42
已采纳

访问相关字段

In FileMaker I have (a.o.) two related tables, where Betreuer_id of table "studentpaper" refers to id of table "Betreuer".

related tables

With help of FileMaker's PHP API, I want to access a record in "studentpaper" including the releated fields. Howerver, the later poses a problem. Consider the following PHP code:

 $findCommand =& $fm->newFindAllCommand('studentpaper');
 $result = $findCommand->execute();
 $records = $result->getRecords();
 $record = $records[0];
 echo $record->getField('Titel'); // okay
 echo $record->getField('Betreuer_id'); // okay
 echo $record->getField('Betreuer::Name'); 
 // ERROR: get empty string, even related record has a non-empty field

I have expected for "Betreuer::Name" the correct related result, as usually in FileMaker (and as I get in studentpaper's layout). However, I get only an empty string. What am I doing wrong? Does the relation in FileMaker's PHP-API differs from the "usual" FileMaker approach?

  • 写回答

1条回答 默认 最新

  • drti52047 2014-06-20 11:34
    关注

    In case anybody is interested, I found the solution on my own.

    The problem was that the field wasn't defined (in the layout) as normal text input, but as selection field resticted by a value list.

    Thus, one needs to access the value not via the usual getField function but by one of the functions related to value lists. In my case, getValueListTwoFields did the job.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 易康econgnition精度验证
  • ¥15 线程问题判断多次进入
  • ¥15 msix packaging tool打包问题
  • ¥28 微信小程序开发页面布局没问题,真机调试的时候页面布局就乱了
  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致