Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

PSOS ExecuteSQL query of FileMaker_Fields not returning related file fields

Featured Replies

  • Newbies

At some point the results of this query has stopped returning any fields from related files. The FMS version is 19.5.2.201. The related files are hosted on the same server, defined in External Data Sources, and have multiple table occurrences on the relationship graph.

SELECT TableName,FieldName,FieldType FROM FileMaker_Fields 
WHERE FieldClass='Normal' AND 
TableName IN (SELECT TableName FROM FileMaker_Tables WHERE BaseFileName NOT LIKE '"& Get(FileName) &" %' )

This returns an empty result. If I just query the FileMaker_Fields table without a WHERE clause, it returns lines only for fields in the local file. 

Here's another query for investigation and result...

SELECT TableName,BaseFileName FROM FileMaker_Tables WHERE BaseFileName NOT LIKE '"& Get(FileName) &" %'

Result:

Activity,
Person,
Registration,

The three TOs from the related file are listed, but notice there is no BaseFileName returned. Queries like the one below return no results.

SELECT TableName,FieldName,FieldType FROM FileMaker_Fields 
WHERE FieldClass='Normal' AND 
TableName = 'Person'

These queries DO return field data as expected for the related file when executed in the local client (19.5.201). This was working in earlier versions of FMS.

Any thoughts about the change in behavior over time and now between the local client and PSOS?

 

Solved by bcooney

Go to solution

might be the wild card '%', try adding an OR to the WHERE;

Quote

(BaseFileName NOT LIKE '"& Get(FileName) &" %' OR BaseFileName NOT LIKE '%"& Get(FileName) &" ' )

 

  • Author
  • Newbies

Unfortunately as I mentioned above, even if I just query the FileMaker_Fields table without a WHERE clause, it returns lines only for fields in the local file…so the records are missing!

  • Solution

Are the credentials cascading to the second file? Is the second file open on the client when you call the psos script?

  • Author
  • Newbies

@bcooney You are 100% on the right track. I forgot I was logged into the local file with a full access admin account, that does not exist in the related file. It was working locally because I had the related file open already before testing. I didn't think it through to realize the credentials for the related file on the client was not carried through.

I'm slapping my forehead. Thanks.

Edited by Daniel Berkman

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.