Contact link with Thirdpart in Module Builder

Hi there,

I’m using Dolibarr since 2017. Recently I upgrade my Dolibarr from 6.0.4 to 11.0.4. Now I’m working with a custom module using builtin module builder. I need help from his community that,

I create a module for taking reference for a letter that working fine. What I face that, When I select a third party it will not automatically update the contact field as there no link between them. I need to link between them “If I select the third-party the contact filed show only contact related to that third-party in card page”.

I will be very happy if anyone can help me out.

Thank you