How to calculate a value of property for a child item using properties from parent item and relationship item?

I am new to Aras development and I am facing a problem now. I am trying to create a Grid Event within a relationship.

I have 2 item types and a relationship type connecting them, which creates the 3rd item types.

ItemType1 (Parent Item) has a property "Quantity1" and has a value in it.

Relationship (Relationship Item) has a property "Rate" and has a value in it as well.

ItemType2 (Child Item) has a property "Quantity2", but its value is empty.

  • ItemType1 (Quantity1)
  • Relationship (Rate)
  • ItemType2 (Quantity2)

I am trying to figure out how to calculate the value by (Quantity1) x (Rate) and set the value to "Quantity2".

I was able to get the Quantity 1 as below.

var parent_item = parent.thisItem;
var parent_quantity = parent_item.getProperty("Quantity1");

But I wasn't able to figure out how to get the "Rate" from the property of Relationship Item.

I hope someone would give me a piece of advice.

Thank you very much in advance.