Javascript to retrieve Referenced Objects

Hello, I have an entity called Location and it has association 1-1 with entity Location2 and this Location2 is referenced to another entity called ‘Image’; I am trying to retrieve all Images (id) which are linked to Location via Location2 using javascript. var locLists = location.getReferences(“MyModule.LOC1_LOC2”); locLists.forEach(location2 => { var temp = location2.getReference(“MyModule.LOC2_IMG”);  → “Error “getReference is not function” }   How can I achieve this?
1 answers

Hi Raghavendra,

I think the first question to ask is: why do you want to do this using JavaScript?