Documentation

crm.externalchannel.activity.company

crm.externalchannel.activity.company

Creates "Company document" activity.

Parameters

See. [link=3954601]method parameters[/link].

Call example for company Activity

BX24.callMethod(
   "crm.externalchannel.activity.company",
   {
        batch:[{
            agent{
                "fields":{
                        "updated field":"value",
                        "ORIGIN_VERSION":"ascFSrbtJfIpEPIEPEnCg==",
                        "ORIGIN_ID":"fff6e1b4-55bc-11d9-848a-00112f43529a-10001", 
                },
                "external_fields":{
                        "EXTERNAL_URL":"company_id=2001",                        
                 },
                "REQUISITE":[{
                            "XML_ID":"faa1c2a9-55bc-11d9-848a-00112f43529a-40001",
                            "RQ_ADDR":{
                                "PRIMARY":{
                                    "ADDRESS_1":"#Street, house, building#",
                                    "ADDRESS_2":"#Apartment / office#",
                                    "CITY":"#City#",
                                    "POSTAL_CODE":"#Postal code#",
                                    "REGION":"#District / area#",  
                                    "PROVINCE":"#Region / province#",  
                                    "COUNTRY":"#Country#",
                                    "COUNTRY_CODE":""
                                    },
                                "HOME":{
                                    "ADDRESS_1":"#Street, house, building#",
                                    "ADDRESS_2":"#Apartment / office#",
                                    "CITY":"#City#",
                                    "POSTAL_CODE":"#Postal code#",
                                    "REGION":"#District / area#",  
                                    "PROVINCE":"#Region / province#",  
                                    "COUNTRY":"#Country#",
                                    "COUNTRY_CODE":""
                                    },
                                "REGISTERED":{
                                    "ADDRESS_1":"#Street, house, building#",
                                    "ADDRESS_2":"#Apartment / office#",
                                    "CITY":"#City#",
                                    "POSTAL_CODE":"#Postal code#",
                                    "REGION":"#District / area#",  
                                    "PROVINCE":"#Region / province#",  
                                    "COUNTRY":"#Country#",
                                    "COUNTRY_CODE":""
                                    },
                                "BENEFICIARY":{
                                    "ADDRESS_1":"#Street, house, building#",
                                    "ADDRESS_2":"#Apartment / office#",
                                    "CITY":"#City#",
                                    "POSTAL_CODE":"#Postal code#",
                                    "REGION":"#District / area#",  
                                    "PROVINCE":"#Region / province#",  
                                    "COUNTRY":"#Country#",
                                    "COUNTRY_CODE":""
                                    }
                                },                    
                                "RQ_NAME":"#Organization#",
                                "RQ_FIRST_NAME":"",
                                "RQ_LAST_NAME":"",
                                "RQ_SECOND_NAME":""
                                "RQ_COMPANY_NAME":"#Abbreviated name of an organization#",
                                "RQ_COMPANY_FULL_NAME":"#Full name of an organization#",
                                "RQ_COMPANY_REG_DATE":"#Date of state registration#",
                                "RQ_DIRECTOR":"#General director#",
                                "RQ_ACCOUNTANT":"#Chief accountant#",                
                                "RQ_CEO_NAME":"",
                                "RQ_CEO_WORK_POS":"",
                                "RQ_CONTACT":"",
                                "RQ_EMAIL":"",
                                "RQ_PHONE":"",
                                "RQ_FAX":"",
                                "RQ_IDENT_DOC":""
                                "RQ_IDENT_DOC_SER":"",
                                "RQ_IDENT_DOC_NUM":"",
                                "RQ_IDENT_DOC_DATE":"",
                                "RQ_IDENT_DOC_ISSUED_BY":"",
                                "RQ_IDENT_DOC_DEP_CODE":"",
                                "RQ_INN":"#INN#",
                                "RQ_KPP":"",
                                "RQ_USRLE":"",
                                "RQ_IFNS":"",
                                "RQ_OGRN":"#OGRN#",
                                "RQ_OGRNIP":"#OGRNIP#",
                                "RQ_OKPO":"#OKTMO#",
                                "RQ_OKTMO":"",
                                "RQ_OKVED":"",
                                "RQ_EDRPOU":"",
                                "RQ_DRFO":"",
                                "RQ_KBE":"",
                                "RQ_IIN":"",
                                "RQ_BIN":"",
                                "RQ_VAT_PAYER":"",
                                "RQ_VAT_ID":"",
                                "RQ_VAT_CERT_SER":"",
                                "RQ_VAT_CERT_NUM":"",
                                "RQ_VAT_CERT_DATE":"",
                                "RQ_RESIDENCE_COUNTRY":"",
                                "BANK_DETAILS":[{"
                                    "RQ_BANK_NAME":"#Bank name#",
                                    "RQ_BANK_ADDR":"#Bank address#",
                                    "RQ_BANK_ROUTE_NUM":"",
                                    "RQ_BIK":"#BIC#",
                                    "RQ_MFO":"",
                                    "RQ_ACC_NAME":"",
                                    "RQ_ACC_NUM":"#Current account#",
                                    "RQ_IIK":"",
                                    "RQ_ACC_CURRENCY":"#Account currency#",
                                    "RQ_COR_ACC_NUM":"#Correspondent account#",
                                    "RQ_IBAN":"",
                                    "RQ_SWIFT":"#SWIFT#",
                                    "RQ_BIC":"",
                                    "COMMENTS":"#Комментарий#",
                                    "XML_ID":"caa2g4q8-55bc-11d9-848a-00112f43529a-50001"
                                    }]
                                }]
            },
            activity{
                "fields":{
                    "updated field":"value"
                },
                "external_fields":{
                    "NUMBER":"N-1\/20160518",
                    "MANAGER":"",
                    "TYPE_ID":"realization"
                     }
            }
        }],
        params:{
                "CHANNEL_ID":"ext_channel.574b405083de90.99016531"
        }
    },
    function(result) 
    {
        if(result.error())
            console.error(result.error());
        else
            console.dir(result.data());
    }
);

Для документов типа Реализация достаточно передавать следующий список полей:

batch:[{
  "agent":{
      "fields":{
            "обновляемое поле":"значение",
            ...
       },
       "external_fields":{
            ...
       }
 "activity":{
        "fields":{
            "ORIGIN_ID":"A_xmlid_1_1_20160516",
            "SUBJECT":"Название документа/дела на портале ",
            "START_TIME":"2016-05-20T12:00:50+04:00",
            "DESCRIPTION":"Произвольное описание документа/дела",
            "RESULT_VALUE":"1",
            "RESULT_SUM":"300",
            "RESULT_CURRENCY_ID":"RUB"
        },
        "external_fields":{
            "NUMBER":"N-1\/20160518",
            "MANAGER":"Иван Иванов",
        }
}],
params:{
     ...
} 

Удаление реквизитов

Если на обновление поступил контрагент без реквизитов, то есть отсутствует массив REQUISITE, то будут удалены все его реквизиты, включая банковские, и адреса. Если реквизиты переданы, но не переданы банковские BANK_DETAILS или адреса RQ_ADDR, то будет удалена та сущность, поле которой не передано.

Поля реквизитов, на которые накладываются по умолчанию языковые ограничения.

Поля, которые будут доступны в форме редактирования реквизитов для языка RU и дефолтном наборе пресетов:

RQ_ADDR 
RQ_NAME 
RQ_FIRST_NAME 
RQ_LAST_NAME 
RQ_SECOND_NAME 
RQ_COMPANY_NAME 
RQ_COMPANY_FULL_NAME 
RQ_COMPANY_REG_DATE 
RQ_DIRECTOR 
RQ_ACCOUNTANT 
RQ_CEO_NAME 
RQ_CEO_WORK_POS 
RQ_CONTACT 
RQ_EMAIL 
RQ_PHONE 
RQ_FAX 
RQ_IDENT_DOC 
RQ_IDENT_DOC_SER 
RQ_IDENT_DOC_NUM 
RQ_IDENT_DOC_DATE 
RQ_IDENT_DOC_ISSUED_BY 
RQ_IDENT_DOC_DEP_CODE 
RQ_INN 
RQ_KPP 
RQ_USRLE 
RQ_IFNS 
RQ_OGRN 
RQ_OGRNIP 
RQ_OKPO 
RQ_OKTMO 
RQ_OKVED

Ограничения для банковских реквизитов для языка RU

RQ_BANK_NAME 
RQ_BANK_ADDR 
RQ_BIK 
RQ_ACC_NUM 
RQ_ACC_CURRENCY 
RQ_COR_ACC_NUM 
RQ_SWIFT


User Comments

User comments are not part of official documentation. Use information provided by other users in the comments at your own risk.

The User Comments section is not to be used as a feature discussion board. Only registered users can post comments. Your comment will be visible once it has been approved by the moderator.
© «Bitrix Inc.», 2001-2019, «Bitrix Inc.», 2019