2013-02-26 96 views
0

我需要能夠爲聯繫人分配多個角色,而不僅僅是唯一一個。現在,我使用下面的代碼到角色設置爲聯繫人:NetSuite - 如何爲聯繫人分配多個角色

  //get the internal ID of created contact 
      var contactInternalId = ((RecordRef) response.baseRef).internalId; 

      //set roles 
      var attachContact = new AttachContactReference(); 
      attachContact.attachTo = new RecordRef 
       { 
        type = RecordType.customer, 
        typeSpecified = true, 
        internalId = customerId 
       }; 
      attachContact.contact = new RecordRef {internalId = contactInternalId}; 
      attachContact.contactRole = new RecordRef {internalId = role}; 

      var resp = _service.attach(attachContact); 

我看沒有辦法多個角色設置爲聯繫人(不同於權限,在那裏我可以使用MultiSeceltCustomFieldRef)。

我試圖搜索互聯網,但它並沒有太多的信息。

我將不勝感激任何幫助,謝謝大家。

回答

0

您可以多次調用attach來分配多個角色。

+0

謝謝,會試試看。 – Pritorian 2013-02-27 09:27:43

+0

不,這不起作用。它只是設置最新提供的角色。 – Pritorian 2013-02-27 12:04:31