Jump to content
Server Maintenance This Week. ×

How to use getField() with related table fields...???


This topic is 3886 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I've got a table called Products and another table called Scans that are related by a field called ScanID. Via the FM PHP API, I'm connecting to a layout in the Scans table.

When I use getField('ScanID') that works great because the field actually resides in Scans. However, I also have fields on this layout from the related Products table (ie. Products::ItemNumber) However, when I try that with getField('Products::ItemNumber') I get nothing back. Simply blank values.

I'm also not getting any errors back when calling getField() on these fields.

Any information on what I'm doing wrong would be greatly appreciated. Thanks!

Link to comment
Share on other sites

An empty portal won't give anything, and if you try to address fields on a different TOG's layout will no ties let you see it. Perspective is obviously the layout and record from where the command is issued, and it picks the first related record only, and if it happens to be empty - shrug!

--sd

Link to comment
Share on other sites

Well, like usual, this was a case of me being an idiot. It just so happens that this record I'm working is one of the very few where this value that's coming back blank...actually is blank in FM!

When I work with a good complete record (like I should be!) everything works great.

Sorry for the bad post.

Link to comment
Share on other sites

  • 5 years later...
  • Newbies

Hi,

 

I am having the same problem for my CNS Audit Table.  I have set a field (in the CNS Audit Table) to equal getField ( "DataTable::Field").  No error message results but the field is empty.  There is a string value  in the field being fetched from.  The two tables are related.  I can also fetch the data from the same field in another related field.  I was wondering why I cannot getField into the CNS Audit Table.  Could some please help?

 

Thanks.

Link to comment
Share on other sites

This topic is 3886 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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