Field in parent object returns undefined in custom compone

  • 1
  • Problem
  • Updated 2 months ago
  • In Progress
I have an issue trying to get the value of a field in a parent object in javascript. 
e.g. Getting the Industry of an Account from a Contact record.

I'm currently using 

skuid.model.getModel(modelName).getFirstRow()[xmlDef.attr('tst')];

Where 'modelName' is the model and 'tst' is the field chosen in the properties(Account__r.Industry). 
I have verified that the field is included in the model.

I am able to get around if by creating a UI-only formula field that references the desired field. 

I am able to get it to return the value if I do the following

skuid.model.getModel(modelName).getFirstRow().Account__r.Industry;

Has anyone else encountered this same issue? Or am I using the incorrect method to get the value? 

Photo of CC

CC

  • 70 Points

Posted 5 months ago

  • 1
Photo of Luzie Baumgart

Luzie Baumgart, Official Rep

  • 2,220 Points 2k badge 2x thumb
Hi CC, I'm sorry that your post was left unanswered for such a long time. If you are still seeing this issue, please check the following documentation for the correct method: https://docs.skuid.com/latest/v1/en/skuid/api/skuid_model_model.html#skuid.model.Model.getFieldValue