Hope you’re doing well.
I’m contacting you because I have problems retrieving an attached entity.
The relationship between theses entities is “belongsToMany” as following :
I want to display the refund request documents in the refund request page (record = refund request).
I tried to return record.documentsThroughRefundRequestDocuments & record.refundRequestDocument but the result is always undefined.
I’ve noticed that I can display the related data record.documentsThroughRefundRequestDocuments but there is to many info, & I want to display the documents in a specific way.
What are your trying to achieve, I mean you say you tried record.documentsThroughRefundRequestDocuments but where are you trying that ? In a Smart View ? Or on your back end ?
Thanks for reaching out.
I’m trying to retrieve the attached documents.
I firstly tried record.documents but the result is undefined.
Is there a way to “include” the document without re-writing the request in the forest refund request view ?
I have the documents on the related data section but I can’t retrieve it from the record nor via a sequelize request (include) & display it in my own way.
It’s because your need to prefix always your attributes/relationships with forest-.
So in your case you need to do record.forest-documentsThroughRefundRequestDocuments. Use the autocompletion on the Smart View Editor it will help you (Ctrl + Space or on Mac it’s Cmd + Space)