Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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


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

Recommended Posts

Posted

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!

Posted

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

Posted

I'm not dealing with a portal. This is just a field in a layout from a related table. When I work with the XML API myself instead of using the PHP API I can use TableName::FieldName to grab data from the layout without any problems.

Posted

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.

  • 5 years later...
  • Newbies
Posted

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.

This topic is 4081 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.