Can't retrieve connected record field

Answered

Comments

2 comments

  • Avatar
    Brad Stevens

    Hi Fred,

    You're trying to retrieve connected field data that doesn't exist without accessing the data in a 'lookup'.  If you log record.field_195_raw[0] to the console (and view it Google Chrome) the output looks like:

    Object {id: "56a8616f1097b2613a7d95ed", identifier: "Johnny Customer"}

    So the only data that comes with field_195 is the id of the client and the identifier that's displayed.

    To set variables for both: 

    var clientID = record.field_195_raw[0].id;
    var clientName = record.field_195_raw[0].identifier;

    If you need any other data from the client object, you'll need to use an Ajax data access call using the id.

    Hope that helps.

  • Avatar
    Fred Smalkin

    Absolutely - thanks!

Please sign in to leave a comment.