+1 vote

Hello,

In general, I really appreciate the option "Link Main Company when Linking Contact".

enter image description here
But for the first time it is a problem for me.

I have a custom where a contact could act "as himself" instead of "as member of his company" within a project. So it is really not user friendly to have this feature for the "project" entity.

But for other entities (documents, actions, opportunities, ...), it is useful.

How could I disable this feature for the project entity ?

Regards,

Loïc

asked in Efficy/ Client side by (531 points)

1 Answer

0 votes
Best answer

Hi Loic,

There is no possibility to deactivate this behavior only for a specific entity. You can use this workflow example to remove the main company

function OnInsertDetailProjCont(editId, detail, detailKey) {
  deleteMainCompRelation(editId, detailKey)
}

function deleteMainCompRelation(editId, k_Contact) {
  var dsComp = Efficy.consultMainCompany(editId, k_Contact),
    dsXxxxComp = Efficy.getDetailDataset(editId, ntComp);

  if (!dsComp || dsComp.isEmpty) return;

  dsXxxxComp.first;
  while (!dsXxxxComp.eof) {
    if (dsXxxxComp.fieldByName("K_COMPANY").asFloat == dsComp.fieldByName("K_COMPANY").asFloat) {
      dsXxxxComp.Delete;     
    } else {
      dsXxxxComp.next;
    }
  }
}
answered by (7.4k points)
selected by
Thanks. I created the suggestion : CFT-2019-99622
1,246 questions
1,517 answers
1,858 comments
328 users