Best way to work with search fields

Best way to work with search fields

Hello,

Im creating a new simple function that creates a new record on a module.
This module as 3 search fiels (one that searches the contacts, other accounts and for last opportunities), so basicly this record its associated with one account, one opportunity and multiple contacts.

My question is, whats the best way to insert the ID to connect.
My currrent code:
  1. cMap = Map();
  2. cMap.put("Name",nome_da_oportunidade);
  3. cMap.put("associated account",id_conta);
  4. cMap.put("associated contact",id_contacto);
  5. cMap.put("associated op",id_oportunidade);
  6. create = zoho.crm.createRecord("Assuntos",cMap);
  7. info create;
Was you can see i'm trying to make the connection this way, but it uses TEXT and not ID... how do i connect this using the ID and not the name?
Also, how do i connect multiple contacts?

Thanks