How to link Potentials record with Contact through the Zoho API v2

How to link Potentials record with Contact through the Zoho API v2

Hello,

I'm trying to create Potentials through the Zoho API v2 as follows:
  1. $record = ZCRMRecord::getInstance("Potentials");
  2. $record->setFieldValue('Deal_Name', 'Phase 2: Vladimir Mitrovic');
  3. $record->setFieldValue('Closing_Date', date('Y-m-d', $_SERVER['REQUEST_TIME']));
  4. $record->setFieldValue('Stage', 'Phase 2 Purchase (Won)');

  5. $record->setLayout(ZCRMLayout::getInstance(POTENTIALS_PHASE2_LAYOUT_ID));

  6. $recordsArray = array();
  7. $recordsArray[] = $record;

  8. ZCRMModule::getInstance("Potentials")->upsertRecords($recordsArray);
Can someone tell me how to link Potentials record with Contact? I tried to set Contact_Name field in several ways, for example
  1. $record->setFieldValue('Contact_Name', CID);
or
  1. $record->setFieldValue('Contact_Name', ZCRMRecord::getInstance("Contacts", CID));
but I'm not sure that using the setFieldValue() method is correct at all, probably need to find some method like setLayout() if there is any for Contacts?

How to set the lookup field in general?

Thank you,
Vladimir