How to modify/get custom relate field in record.js

Hi All

How to get custom relate field id in record.js

i have one contact relate field & one account relate field on case recordview  so when i have select one contact

1. how to get that contact ID. ??

2. how to modify / Set Account relate field based on Contact selected.. ??

and How to get Selected Contact Bean for fetching other contact details. ??

Ajay Kumar